小编e.a*_*rio的帖子

如何读取包含在gz文件中的文件名

我试过读一个gz文件:

with open(os.path.join(storage_path,file), "rb") as gzipfile:
        with gzip.GzipFile(fileobj=gzipfile) as datafile:
            data = datafile.read()
Run Code Online (Sandbox Code Playgroud)

它工作,但我需要文件名和我的gz文件中包含的每个文件的大小.此代码将包含文件的内容打印到存档中.

如何读取此gz文件中包含的文件名?

python compression gzip

7
推荐指数
1
解决办法
3299
查看次数

标签 统计

compression ×1

gzip ×1

python ×1