2024-09-29 01:26:57 发布
网友
我是这样解码gzip电子编码的:
gzipper = gzip.GzipFile(fileobj=wepage_response) decoded_str = str(gzipper)
现在解码的字符串如下所示:
我该怎么解释?在
谢谢你
您需要read()来自gzipper实例的内容:
read()
gzipper
import gzip from cStringIO import StringIO webpage_response = '\x1f\x8b\x08\x08\xe6|\xdfS\x00\x03test.txt\x00\xcb\xc8T(\xc9H-J\xe5\x02\x00\xb6\x0b\x88\x9b\t\x00\x00\x00' gzipper = gzip.GzipFile(fileobj=StringIO(webpage_response)) decompressed_str = gzipper.read() >>> decompressed_str 'hi there\n'
您需要
read()
来自gzipper
实例的内容:相关问题 更多 >
编程相关推荐