Currently, I have a big zip file splited into 3 file test.zip, test.z01, test.zip02
I use zipfile library in python to extract these file, but encounter the
error: "BadZipFile: Bad magic number for file header"
with zipfile.ZipFile("test.zip","r") as file:
file.extractall(folder_path)
Anyone know how to extract these file with Python.
Calling command line interfare of 7zip/winrar in python should solve this problems
import subprocess
unzip_command = '"C:\\Program Files\\7-Zip\\7z.exe"' + ' e ' + '"' + folder_path + '"'
subprocess.run(unzip_command, shell = True, cwd = folder_path)
The code above will extract all file in folder_path folder and store the file in this
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With