How can I execute this command using python's subProcess module
gunzip --name /tmp/file.gz > /home/aaaa/
How can I execute this command using python's subProcess module
gunzip --name /tmp/file.gz > /home/aaaa/
You can use subprocess
and redirect your output to a file:
import subprocess
output_file = open("/home/aaaa/myoutput", "w")
subprocess.call(["gunzip", "--name", "/tmp/file.gz"], stdout=output_file)