I'm trying to extract files from a 7z format using python. Can some tell how it can be done on python 3.6?
Asked
Active
Viewed 1.0k times
5
-
You can use py7zr, which supports 7zip archive compression, decompression, encryption and decryption. https://github.com/miurahr/py7zr/ – Zhou Hongbo Jul 21 '20 at 10:56
1 Answers
-5
You can use the following : https://pypi.org/project/pyunpack/
Or you can use the following : from zipfile import ZipFile
with ZipFile('your_zip_file.zip') as zipArch: #or a 7z file
zipArch.extractall("dest_folder", pwd=bytes('the_zip_password','utf-8')) #If it is password protected

DeathJack
- 595
- 1
- 6
- 26