Skip to content

Instantly share code, notes, and snippets.

@epatr
Created July 18, 2016 19:02
Show Gist options
  • Save epatr/a82c7acd0b8010a9e0e61d0eab353aa2 to your computer and use it in GitHub Desktop.
Save epatr/a82c7acd0b8010a9e0e61d0eab353aa2 to your computer and use it in GitHub Desktop.
import os
import urllib2
print("Opening urls.txt...")
for url in open('urls.txt'):
filename = url.split('/')[-1].rstrip()
if not os.path.exists(filename):
print("Downloading"),
print filename
outfile = open(filename, "w")
outfile.write(urllib2.urlopen(url).read())
outfile.close
print("Complete!")
print("All files are complete!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment