Skip to content

Instantly share code, notes, and snippets.

@abevieiramota
Last active August 29, 2015 14:01
Show Gist options
  • Save abevieiramota/1f344143542940584ba4 to your computer and use it in GitHub Desktop.
Save abevieiramota/1f344143542940584ba4 to your computer and use it in GitHub Desktop.
script para download do livro Digital Signal Processing, disponível gratuitamente em http://www.dspguide.com/pdfbook.htm
import urllib2
caps = range(1, 35)
url_template = 'http://www.dspguide.com/CH%d.PDF'
file_template = 'ch%d.pdf'
for cap in caps:
pdf = urllib2.urlopen(url_template % cap)
f = open(file_template % cap, 'w')
for line in pdf.readlines():
f.write(line)
f.close()
pdf.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment