Downloading files over HTTP
The problem #I like to download podcasts from this site #http://www.gardnermuseum.org/music/listen/podcasts #http://stackoverflow.com/questions/22676/how-do-i-download-a-file-over-http-using-python #what it the location of the file to download #"http://traffic.libsyn.com/gardnermuseum/theconcert198.mp3" #original line of code #urllib.urlretrieve ("http://traffic.libsyn.com/gardnermuseum/theconcert198.mp3", "mp3.mp3")
The program import urllib for x in range(1, 3): print x source = "http://traffic.libsyn.com/gardnermuseum/theconcert"+str(x)+".mp3" print source target = "theconcert" +str(x)+".mp3" print target urllib.urlretrieve (source, target)