Jak kompresować za pomocą 7zip zamiast zip, zmiana kodu
Mam kod, który kompresuje każdy plik w określonym folderze za pomocą zip, ale chcę go skompresować za pomocą 7zip, więc jak to zrobić?
Oto, co mam do tej pory:
for date in dict_date:#zipping folders and get same name like the folder
with ZipFile(os.path.join(src, '{0}.7z'.format(date)), 'w') as myzip:
for subFolder in dict_date[date]:
for fil in os.listdir(os.path.join(src, date, subFolder)):
if not fil.endswith('.7z'):
myzip.write(os.path.join(src, date, subFolder, fil))