user17383045
user17383045

Reputation: 11

How to download something using Python

I am trying to create a python program that allows the user to downlaod whatever they write down (kind of like a little notepad tool). I figured everything out other than how to allow the user to download after they finished. Is there a built in function or a library that could allow this? Thanks!

Upvotes: 0

Views: 53

Answers (2)

Paulo
Paulo

Reputation: 1498

I believe you're talking about requests from python.

You can try something like this:

import requests as rq
url = "www.yoursite.com"
ret = rq.get(url)
print(ret.text)

You can start with that, but you need to study more about requests. You can read about it here:

https://pypi.org/project/requests/

https://www.w3schools.com/python/module_requests.asp

I hope that helps you.

Upvotes: 0

SaC-SeBaS
SaC-SeBaS

Reputation: 172

You can use wget to fetch url content.

Example:

import wget
url = 'www.your_url.com'
filename = wget.download(url)

Upvotes: 1

Related Questions