gzip sample
import zlib buf="" with open("hoge.gz") as f: buf = f.read() z = zlib.decompressobj(16+zlib.MAX_WBITS) print z.decompress(buf)