I am trying to extract a .tgz file by calling 7-zip using the subprocess function (helpful stack overflow post here)
I need to call subprocess twice. First to unzip from .tgz --> .tar and second to unzip from .tar --> .txt
My code successfully unzips the first step, but nothing happens on the second step, any ideas why?
subprocess.Popen([r'C:\Program Files\7-Zip\7z.exe', 'e', '-y', '-r', '-o' + pth, os.path.join(root, 'myZip.tgz')])
subprocess.Popen([r'C:\Program Files\7-Zip\7z.exe', 'e', '-y', '-r', '-o' + pth, os.path.join(pth, 'myZip.tar')])
"pth" is the output path and "root" is the path where the original zipped file is. I opened up the pth folder and there is in fact a myZip.tar file there.