gpt4 book ai didi

python-3.6 - 有没有办法使用 Python 3 从 7z 格式中提取文件?

转载 作者:行者123 更新时间:2023-12-03 22:44:15 25 4
gpt4 key购买 nike

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





How to read contents of 7z file using python

(5 个回答)


2年前关闭。




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

最佳答案

您可以使用以下内容:
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

关于python-3.6 - 有没有办法使用 Python 3 从 7z 格式中提取文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54743252/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com