read Zipfile

Tim Chase python.list at tim.thechases.com
Mon Nov 2 21:29:44 EST 2009


> Looks like you'd have to use the more primitive .read() method:
> http://docs.python.org/library/zipfile.html#zipfile.ZipFile.read

Unfortunately, the ZipFile.read() reads the entire content.  One 
of the main reasons to zip things is that they're big -- possibly 
too big to fit conveniently in memory.  I don't know about the 
OP's use-case, so .read() might suffice if the resulting content 
is small enough.  In my case[1], it was a zip containing multiple 
 >700MB MS-Access .mdb files that I needed to stream to temporary 
disk storage and using .read() killed my dev machine.

-tkc

[1]
http://markmail.org/message/7vn5shss2h64yoop






More information about the Python-list mailing list