xxxxxxxxxx
# download it from here
https://www.python.org/downloads/release/python-379/
xxxxxxxxxx
import wget
# Specify the URL for downloading Python 3.9 for Windows
url = 'https://www.python.org/ftp/python/3.9.9/python-3.9.9-amd64.exe'
# Specify the local path where the file will be saved
local_path = 'python-3.9.9-amd64.exe'
# Download Python 3.9 installer for Windows
wget.download(url, local_path)
xxxxxxxxxx
# https://www.python.org/downloads/release/python-370/
# change the last 3 digits in the link to determine version
# (e.g: '370' -> 3.7.0 && if you want 3.7.5 version just change them to '375')
xxxxxxxxxx
import requests
# URL of the Python 3.9.0 download page
url = 'https://www.python.org/downloads/release/python-390/'
# Send a GET request to the URL
response = requests.get(url)
# Save the contents of the page to a file
with open('python-3.9.0.tar.gz', 'wb') as file:
file.write(response.content)
print('Python 3.9.0 downloaded successfully!')