Python 模块-zipfile

压缩,解压操作

import zipfile

# 压缩
# z = zipfile.ZipFile('123.zip', 'w')
# z.write('123')
# z.write('789')
# z.close()

# 解压
z = zipfile.ZipFile('123.zip', 'r')
z.extractall()
z.close()
原文地址:https://www.cnblogs.com/Linc2010/p/8598428.html