Python 解压缩 1.7z 文件到 C:\
将 1.7z 文件重命名为 1.zip,然后使用 Python 的 zipfile 模块进行解压缩:
import zipfile
with zipfile.ZipFile('C:\1.zip', 'r') as zip_ref:
zip_ref.extractall('C:\')
步骤:
- 将 1.7z 文件重命名为 1.zip
- 使用
zipfile.ZipFile()函数打开 1.zip 文件 - 使用
extractall()方法将所有文件解压缩到 C:\ 目录
原文地址: https://www.cveoy.top/t/topic/oihu 著作权归作者所有。请勿转载和采集!