do I need popen or something else

Peter Hansen peter at engcorp.com
Sun Dec 15 15:19:18 EST 2002


P_spam_ at draigBrady.com wrote:
> 
> Well if you don't want to parse the output you can just:
> os.system("myappname.exe") and the output will go
> to sys.stdout

This might be read to imply that if you redirected sys.stdout,
the output of programs launched via os.system() would go
there instead.  This is not the case.

os.system() starts up a new process, and the output goes to
where the output of the original program was directed, which
is often just the console, regardless of what you do with
sys.stdout.  I think you might have meant to say something
like "the output bypasses Python and goes to stdout and/or
stderr as it normally would".

-Peter



More information about the Python-list mailing list