File Downloading

Hiata hiata2002 at yahoo.com.br
Fri Aug 23 11:14:13 EDT 2002


But I dont't know the local_file.
  I wana do this by my html page.


"Fredrik Lundh" <fredrik at pythonware.com> wrote in message news:<79y69.4164$HY3.1167799 at newsc.telia.net>...
> Denis S. Otkidach wrote:
> 
> > H> I need a script to download a file (any kind of file).
> > H> Can you help me?
> >
> > from shutil import copyfileobj
> > from urllib import urlopen
> >
> > in_fp = urlopen(remote_url)
> > out_fp = open(local_file, 'wb')
> > copyfileobj(in_fp, out_fp)
> 
> or, shorter:
> 
>     import urllib
> 
>     urllib.urlretrieve(remote_url, local_file)
> 
> </F>



More information about the Python-list mailing list