subprocess.call(*args **kwargs) on Linux

Leif K-Brooks eurleif at ecritters.biz
Mon Jun 20 07:40:22 EDT 2005


McBooCzech wrote:
> This is easy. Subprocess function "call" looks:
> returncode = subprocess.call(["/root/dex/dex","/dev/ttyS0",
> "blabla.txt"])
> and it runs smoothly.
> 
> The problem starts when I am trying to add 1>/dev/null 2>/dev/null
> parameters to suppres output sendings.

from subprocess import call, STDOUT
call(["command", "arg", "arg"], stdout=open("/dev/null", "w"),
                                stderr=STDOUT)



More information about the Python-list mailing list