Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
file_python3.py
#!/bin/python3
import time
import shutil
import requests
start_time = time.time()
links_website = {
"Python-3.7.0a2.tgz": "http://ipv4.download.thinkbroadband.com/1GB.zip",
"Python-3.6.0.tgz": "http://ipv4.download.thinkbroadband.com/1GB.zip",
"Python-3.5.0.tgz": "http://ipv4.download.thinkbroadband.com/1GB.zip",
"Python-3.4.0.amd64.msi": "http://ipv4.download.thinkbroadband.com/1GB.zip",
"python-3.7.0a1.exe": "http://ipv4.download.thinkbroadband.com/1GB.zip",
"python-2.7.9rc1.amd64.msi": "http://ipv4.download.thinkbroadband.com/1GB.zip",
"python-2.7.9-macosx10.6.pkg": "http://ipv4.download.thinkbroadband.com/1GB.zip",
"python-3.6.2rc2-macosx10.6.pkg": "http://ipv4.download.thinkbroadband.com/1GB.zip",
"python-3.6.2rc1.exe": "http://ipv4.download.thinkbroadband.com/1GB.zip",
"python-3.6.2.exe": "http://ipv4.download.thinkbroadband.com/1GB.zip"
}
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