[Tutor] Python riddles - zip question

jfouhy@paradise.net.nz jfouhy at paradise.net.nz
Tue May 10 00:43:33 CEST 2005


Quoting "D. Hartley" <denise.hartley at gmail.com>:

> How do I open a zipfile? I see commands for closing it, but i only see
> "class zipfile" - no command like urlopen() (!!!)

Look at the constructor :-)

>>> import zipfile
>>> z = zipfile.ZipFile('myzip.zip')
>>> z.printdir()
 ...

-- 
John.


More information about the Tutor mailing list