Gzip - gunzip using zlib

Paul Rubin http
Fri Jun 8 23:24:45 EDT 2007


flebber <flebber.crue at gmail.com> writes:
> Hi Can anyone show me a working example of how to use gzip to
> decompress a file. I have read the docs at python.org and had many
> goes at it but just can't get it to work.

Untested in this instance, but this is how I usually do it:

    import gzip

    z = gzip.open('parrot.gz')
    for line in z:
       ...



More information about the Python-list mailing list