How to capture output of os.spawnv()?

Donn Cave donn at drizzle.com
Wed Feb 13 18:00:16 EST 2002


Quoth grante at visi.com (Grant Edwards):
| I'd like to capture stdout/stderr from a program run with
| os.spawnv().  
|
| I've searched through c.l.p archives, and the usual answer
| seems to be "use popen2 et al".  I don't want to use popen
| since it runs the program as a shell command and I don't want
| the shell to mess with the strings I'm passing as arguments to
| the programs.

Check it out.  Not popen, but as they say, "popen2 et al."
It will exec the command on its own, no shell, if you give it
an argument list.  If you give it a string, it will use the
shell.

	Donn Cave, donn at drizzle.com



More information about the Python-list mailing list