File Downloading

Denis S. Otkidach ods at fep.ru
Tue Aug 13 17:57:10 CEST 2002


On 13 Aug 2002, Hiata 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)

-- 
Denis S. Otkidach
http://www.python.ru/      [ru]
http://diveinto.python.ru/ [ru]





More information about the Python-list mailing list