[Tutor] URLLIB

Kent Johnson kent37 at tds.net
Fri May 13 13:52:20 CEST 2005


Servando Garcia wrote:
> Hello list
> I am on challenge 5. I think I need to some how download a file. I have 
> been trying like so
> 
> X=urllib.URLopener(name,proxies={'http':'URL').distutils.copy_file('SomeFileName') 

urlopener() returns a file-like object - something that behaves like an open file. Try
x = urllib.urlopener(name)
data = x.read()

Kent



More information about the Tutor mailing list