Downloading multiple files based on info extracted from CSV

Matt Graves tunacubes at gmail.com
Mon Dec 16 09:17:47 EST 2013


On Thursday, December 12, 2013 5:20:59 PM UTC-5, Chris Angelico wrote:

> import urllib
> 
> import csv
> 
> 
> 
> # You actually could get away with not using a with
> 
> # block here, but may as well keep it for best practice
> 
> with open('clients.csv') as f:
> 
>     for client in csv.reader(f):
> 
>         urllib.urlretrieve(client[7], client[0] + ".csv")
> 
> 
> 
> Yep, that's it! That's all you need. 


Worked perfect. Thank you!



More information about the Python-list mailing list