Skip to content

Instantly share code, notes, and snippets.

@rochacbruno
Created March 29, 2011 02:33
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 rochacbruno/891713 to your computer and use it in GitHub Desktop.
Save rochacbruno/891713 to your computer and use it in GitHub Desktop.
download files with Python
#python rocks!
import os
from urllib import urlretrieve
for item in ['http://coelba.sma-se.com.br/pdfs/055ECD0A.pdf','http://coelba.sma-se.com.br/pdfs/11E2C46D.pdf']:
os.system('mkdir %s' % item.split('/')[-1].replace('.pdf',''))
urlretrieve(item,'/home/rochacbruno/%s/%s' % (item.split('/')[-1].replace('.pdf',''), item.split('/')[-1]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment