Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 Python 中创建 *.7z 文件? 请写一个简单的小例子。
可以尝试使用py7zr,它支持 7zip 压缩包、解压、加密、解密。https://github.com/miurahr/py7zr
对于 .7z 创建,请使用以下代码:
import py7zr with py7zr.SevenZipFile('target.7z', 'w') as z: z.writeall('./base_dir')
你需要py7zlib,看到这个问题