📦
Downloading file
The following code download the file from the given URL.
I use this script in iPhone to download files from any URLs.
![Screenshot of Python script that downloads files. Screenshot of Python script that downloads files.](/static/41c970c6c7fdc60708145ebc0d2e35dc/8e1fc/python-download-file.jpg)
from urllib.request import urlretrieve
url = input('URL: ')
filename = url.split('/')[-1]
urlretrieve(url, filename)
print("Downloaded file: {}".format(filename))