Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import time
import shutil
import requests
start_time = time.time()
links_website = {
"Python-3.7.0a2.tgz": "",
"Python-3.6.0.tgz": "",
"Python-3.5.0.tgz": "",
"Python-3.4.0.amd64.msi": "",
"python-3.7.0a1.exe": "",
"python-2.7.9rc1.amd64.msi": "",
"python-2.7.9-macosx10.6.pkg": "",
"python-3.6.2rc2-macosx10.6.pkg": "",
"python-3.6.2rc1.exe": "",
"python-3.6.2.exe": ""
for k, v in links_website.items():
print("Downloading file {}".format(k))
r = requests.get(v, stream=True)
with open(k, "wb") as f:
shutil.copyfileobj(r.raw, f)
print("File downloaded")
print("time {}".format((time.time() - start_time)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment