There is a post on this topic already, but it does not have an explicit answer to the fundamental question which I am re-asking here:
How do you make 7zip commands from
import subprocess cmd = ['7z', 'a', 'Test.7z', 'Test', '-mx9'] sp = subprocess.Popen(cmd, stderr=subprocess.STDOUT, stdout=subprocess.PIPE)