Skip to content

Instantly share code, notes, and snippets.

@gabrielrojasnyc
Created October 22, 2017 22:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gabrielrojasnyc/064fa19e2afcd0ac3e8f53335dadead9 to your computer and use it in GitHub Desktop.
Save gabrielrojasnyc/064fa19e2afcd0ac3e8f53335dadead9 to your computer and use it in GitHub Desktop.
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