I'm trying to extract archives of different types (such as: *.7zip, *.V3P, *.Q4P) to a specific folder with using a subprocess.
import subprocess
archname = "E:\\temp\\payments.zip"
dir7z = "C:\\Program Files\\7-Zip\\7z.exe"
def extractfiles(archname):
system = subprocess.Popen([dir7z, "x", archname])
return (system.communicate())
extractfiles(archname)
This code extracting files to the project folder, but I want extract them to the specific folder as "E:\temp\". I know 7zip command on the Windows command line:
7z x E:\temp\payments.zip -o"E:\temp\"
Please, help me implement that 7zip command from Python