Need script to download file at known address

Alex Martelli aleaxit at
Wed Sep 15 17:20:43 CEST 2004

Radioactive Man <rm at rm.rm> wrote:

> I am fairly new to the latest verion of Python and using it on windows
> 95, 2000, and/or XP.  What libraries, modules, functions, etc. would I
> need to set up a Python script to download a file, say
> "htttp://" to my own hard drive at
> "c:\sound\bob.wav"?  

Something like:

import urllib
urllib.urlretrieve( "htttp://",

should be fine.

> I haven't found any good examples of such an operation in the
> documentation at the Python website.  Any suggestions are appreciated. has the docs of
urlretrieve, and it's SO simple that I don't really see what "good
examples" one might provide.  A book that by design is full of examples
(hopefully good) is the Python Cookbook, which in the intro to Chapter
10 (Network Programming) gives a slightly richer example which downloads
several files with urllib.urlretrieve. may have some useful pointers,
/Q_21048439.html has exactly the same question you asked, but you have
to "sign up" to see the solution (always the same one).


More information about the Python-list mailing list