如何创建存档test.zip,将其分解为具有最大卷文件大小的卷
import os, zipfile
def zip_dir(path, zp):
for entry in os.scandir(path):
zp.write(entry.path)
if entry.is_dir(follow_symlinks=False):
zip_dir(entry.path, zp)
if __name__ == '__main__':
max_size = 1024 # ?
with zipfile.ZipFile('test.zip', 'w', zipfile.ZIP_DEFLATED) as zp:
zip_dir('libs', zp)
zip_dir('.idea', zp)