how to gunzip a string ?
fredrik at pythonware.com
Wed Jul 30 19:47:43 CEST 2003
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
> I managed to do it with the gzip library only after saving the string to a
> file and then opening and reading it
> with gzip.open, but it's extremely ugly.
> any suggestions ?
interface code (based on john j. lee's posting):
from GzipConsumer import GzipConsumer
def __init__(self): self.data = 
def feed(self, data): self.data.append(data)
c = stupid_gzip_consumer()
gzc = GzipConsumer(c)
unzipped_data = gunzip(gzipped_data)
More information about the Python-list