Downloading Large Files -- Feedback?
Alex Martelli
aleaxit at yahoo.com
Sun Feb 12 22:02:39 EST 2006
mwt <michaeltaft at gmail.com> wrote:
...
> import urllib
>
> def download_file(filename, URL):
> f = urllib.urlretrieve(URL, filename, reporthook=my_report_hook)
If you wanted to DO anything with the results, you'd probably want to
assign to
f, m = ...
not just f. This way, f is the filename, m a message object useful for
metadata (e.g., content type).
Otherwise looks fine.
Alex
More information about the Python-list
mailing list