目前,我有一个很大的zip文件被分割成3个文件test.zip,test.z01,test.zip02
我使用python中的zipfile库来解压缩这些文件,但是遇到了
error: "BadZipFile: Bad magic number for file header"
with zipfile.ZipFile("test.zip","r") as file:
file.extractall(folder_path)
任何人都知道如何使用Python提取这些文件。
发布于 2017-09-24 03:43:48
在python中调用7zip/winrar命令行接口可以解决这个问题。
import subprocess
unzip_command = '"C:\\Program Files\\7-Zip\\7z.exe"' + ' e ' + '"' + folder_path + '"'
subprocess.run(unzip_command, shell = True, cwd = folder_path)
上面的代码将提取folder_path文件夹中的所有文件,并将该文件存储在
https://stackoverflow.com/questions/46379881
复制相似问题