常用模块 压缩 解压 zipfile

压缩
import zipfile
z = zipfile.ZipFile('test.zip','w')
z.write('b.json')
z.write('c.json')

解压
z = zipfile.ZipFile('test.zip', 'r')
z.extractall(path='.')
z.close()

猜你喜欢

转载自www.cnblogs.com/len1028/p/11818087.html