I'm calling a subprocess and want to disable any output to my shell. I'm trying to do this with:
with tempfile.TemporaryFile() as tempf:
proc = Popen(cmd, stdout=tempf, stderr=tempf)
proc.communicate()
But there is still some output (but less than normally) appearing at the terminal. Could the problem be that the called process uses os.execvp
? Any suggestions to fully disable the output for all subprocesses?
Note
Redirecting to devnull is a better way of disabling output:
with open(os.devnull, 'w') as tempf:
proc = Popen(cmd, stdout=tempf, stderr=tempf)
proc.communicate()
Question answered!
Very simple solution: The called process uses CORBA and the server is actually printing out.