File-like objects for reading zip files?

Levente Sandor nospam at newsranger.com
Mon Jul 2 07:51:22 EDT 2001


wxPython -- http://wxpython.org -- has a wxZipFSHandler class with FindFirst,
FindNext and OpenFile methods. I hope this will help you.

Levi

In article <9hks27$549$1 at slb2.atl.mindspring.net>, Greg Landrum says...
>
>Hi,
>
>I have a .zip archive containing a very large text file (~2.3 MB compressed,
>~520MB uncompressed).  I'd like to have a file-like object for working with
>this file so that I never need to uncompress it.  In case this isn't clear
>enough, I'd like to be able to do something like this:
>
>import magiczipthing
>f = magiczipthing.FileLikeObject('bigfile.zip','r')
>l = f.readline()
>while l:
>    process_line(l)
>    l = f.readline()
>
>From my perusal of the docs, it doesn't look like the zipfile module
>supports this type of interaction.
>
>Is there any way to accomplish this task?
>
>Thanks,
>-greg
>
>





More information about the Python-list mailing list