Redirecting system output quietly

Donn Cave donn at u.washington.edu
Tue Nov 16 13:01:20 EST 2004


In article <abf57198.0411160816.26d192c9 at posting.google.com>,
 hugonz at hotmail.com (Hugo Gonz?lez) wrote:

> There's an even easier way to do this. You can use the "commands"
> module:
> 
> http://www.python.org/doc/current/lib/module-commands.html
> 
> This is easier and faster than using popen, and will allow you to get
> exit status (os.popen* won't let you)

You can look at the implementation, it's a Python source file
commands.py in the library directory.  I mention that because
you might be interested to see how it uses os.popen, and gets
the status.

   Donn Cave, donn at u.washington.edu



More information about the Python-list mailing list