subprocess-how to suppress the stdout

Fredrik Lundh fredrik at
Thu Oct 26 17:24:08 CEST 2006

alf wrote:

>> /dev/null is your friend:
>>     Popen(..., stdout=open("/dev/null", "w"), stderr=subprocess.STDOUT, ...)
> I am forced to use win32 :-( plus it needs to be platform independent ...

alright, os.devnull is your friend:

  Popen(..., stdout=open(os.devnull, "w"), stderr=subprocess.STDOUT, ...)


More information about the Python-list mailing list