python download code example
Example 1: python download image
import urllib.request
image_url = 'https://bit.ly/2XuVzB4'
save_name = 'my_image.jpg'
urllib.request.urlretrieve(image_url, save_name)
Example 2: how to install python libraries
python -m pip install SomePackage
Example 3: how to install modules in python
pip install
Example 4: pip install python 3
You cannot just pip install python3 because it is not a library.
If you want to install the latest python3:
https://www.python.org/ftp/python/3.8.2/python-3.8.2.exe
Example 5: python3 download file
import urllib.request
print('Beginning file download with urllib2...')
url = 'http://i3.ytimg.com/vi/J---aiyznGQ/mqdefault.jpg'
urllib.request.urlretrieve(url, '/Users/scott/Downloads/cat.jpg')
Example 6: latest version of python
% brew install python3