Need script to download file at known address

Pierre Fortin pfortin at
Wed Sep 15 02:57:06 CEST 2004

On Wed, 15 Sep 2004 00:00:21 GMT Radioactive 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"?  
> I haven't found any good examples of such an operation in the
> documentation at the Python website.  Any suggestions are appreciated.
> Thanks.

See:  11. Internet Protocols and Support

In this example, Yahoo uses 00=Jan, so 08=Sep...

>>> from urllib import urlopen
>>> URL1 = ""
>>> URL2 = "s=IBM&a=08&b=14&c=2004&d=08&e=14&f=2004&g=d&ignore=.csv"
>>> urlopen("%s%s" % (URL1,URL2)).readlines()
['Date,Open,High,Low,Close,Volume,Adj. Close*\n',
'14-Sep-04,86.60,86.88,86.15,86.72,3953500,86.72\n', '<!-- uncompressed Tue Sep 14 17:55:33 PDT 2004

More information about the Python-list mailing list