Re: how to gunzip a string ?

Discussion in 'Python' started by Andreas Kuntzagk, Jul 31, 2003.

  1. On Wed, 30 Jul 2003 16:16:32 +0200, Bill Loren wrote:

    > I guess I really need some sort of library that will do a gzip decoding to
    > a compressed string.
    > assume that I have a gzipped_string_reply I got from an HTTP server, It'd
    > be superb to have a gunzip class that takes it and return its decoded
    > equivalent.



    You could put your string in an cStringIO:

    c_string= cStringIO.StringIO(compressed_string)
    gzip_handle=gzip.GzipFile(fileobj=c)
    gzip_handle.read()

    HtH, Andreas
     
    Andreas Kuntzagk, Jul 31, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bill Loren

    Re: how to gunzip a string ?

    Bill Loren, Jul 31, 2003, in forum: Python
    Replies:
    0
    Views:
    1,106
    Bill Loren
    Jul 31, 2003
  2. Replies:
    2
    Views:
    1,313
  3. flebber

    Gzip - gunzip using zlib

    flebber, Jun 9, 2007, in forum: Python
    Replies:
    2
    Views:
    380
    Stefan Behnel
    Jun 9, 2007
  4. kj
    Replies:
    3
    Views:
    838
  5. Istvan Gouritz
    Replies:
    0
    Views:
    252
    Istvan Gouritz
    Oct 11, 2010
Loading...

Share This Page