문제

How to create *.7z file in Python? Please write an small-simple example.

도움이 되었습니까?

해결책

You can try using py7zr, which supports 7zip archive compression, decompression, encryption, decryption. https://github.com/miurahr/py7zr

For .7z creation, use this code:

import py7zr
with py7zr.SevenZipFile('target.7z', 'w') as z:
    z.writeall('./base_dir')

다른 팁

You need py7zlib, see this question

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top