有没有办法使用Python 3从7z格式提取文件? [重复]

问题描述 投票:-1回答:1

这个问题在这里已有答案:

我正在尝试使用python从7z格式中提取文件。有人可以告诉如何在python 3.6上完成它吗?

python-3.6 7zip
1个回答
0
投票

您可以使用以下内容:https://pypi.org/project/pyunpack/

或者您可以使用以下内容:从zipfile导入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
© www.soinside.com 2019 - 2024. All rights reserved.