ZIP format compression
|
|
import pyzippervsimport zipfile
pyzipperis mostly API-compatible withzipfile.
zipfilecan use passwords mainly when extracting, but does not support creating AES-encrypted ZIP files.pyzippersupports creating encrypted ZIP files.zf.write(path1, path2)
path1: source file path to compress
path2: path inside the ZIP archivepyzipper.AESZipFile- Encryption-related parameters
encryption=pyzipper.WZ_AES(AES encryption)
zf.setpassword(b"password")(set password)
7z format compression
|
|
-
archive.writeall(path1, path2)
path1: source path to compress (can be a directory)
path2: target path inside the 7z archive;''means archive root -
Encryption parameter
password='password'