#读取压缩包zip内文件 zipfile.ZipFile() .namelist()
#读取压缩包内文件信息 .getinfo()
#读取压缩文件 import zipfile with zipfile.ZipFile('我的文件夹.zip','r') as zipobj: print(zipobj.namelist()) #以列表形式输出压缩包的文件 #读取压缩包内文件信息 for file_name in zipobj.namelist(): info= zipobj.getinfo(file_name) print(file_name,info.file_size,info.compress_size)
标签:namelist,读取,getinfo,ZipFile,zipobj,zipfile,压缩包 From: https://www.cnblogs.com/988MQ/p/16819661.html