Skip to content

Instantly share code, notes, and snippets.

@Fluffywuffy
Forked from oculushut/downloadEnron.py
Created January 14, 2019 23:39
Show Gist options
  • Save Fluffywuffy/5321c383afc1b67597d8f0bf5ac02cec to your computer and use it in GitHub Desktop.
Save Fluffywuffy/5321c383afc1b67597d8f0bf5ac02cec to your computer and use it in GitHub Desktop.
Example for using Python to download file
##Python 2
#import urllib
#url = "https://www.cs.cmu.edu/~./enron/enron_mail_20150507.tgz"
#urllib.urlretrieve(url, filename="../enron_mail_20150507.tgz")
#print "download complete!"
##Python 3
import urllib.request
url = "https://www.cs.cmu.edu/~./enron/enron_mail_20150507.tgz"
print ("download start!")
filename, headers = urllib.request.urlretrieve(url, filename="e:\\PythonStuff\\enron_mail_20150507.tgz")
print ("download complete!")
print ("download file location: ", filename)
print ("download headers: ", headers)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment