📜  python compactar arquivo antes de exportar - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:01.479000             🧑  作者: Mango

代码示例1
import zipfile

z = zipfile.ZipFile('final.zip', 'w', zipfile.ZIP_DEFLATED)
z.write('file1.txt')
z.write('file2.txt')
z.close()