""" 文件、文件夹打包成 .zip。 模块:python3 zipfileModule 文件、文件夹压缩、打包.py 参考:https://www.cnblogs.com/ManyQian/p/9193199.html 知识点: 1.参考:《zipfile 知识点.txt》 """ import zipfile # 创建一个 test.zip 文档。 zFile = zipfile.ZipFile('test.zip', 'w', compression=zipfile.ZIP_STORED) print(type(zFile)) # <class 'zipfile.ZipFile'> # 将文件 cs.py 添加到压缩文档 test.zip/cs/cs.py。 zFile.write('cs.py', 'cs/cs.py', zipfile.ZIP_STORED) zFile.close()
python3 zipfileModule 文件、文件夹压缩、打包.py
最新推荐文章于 2024-04-28 19:58:47 发布