How to get output of command called by os.system()?

Chris Rebert clp2 at rebertia.com
Sat Oct 31 02:16:42 EDT 2009


On Fri, Oct 30, 2009 at 11:09 PM, Peng Yu <pengyu.ut at gmail.com> wrote:
> I need to integrate shell program with python. I'm wondering if there
> is a way get the output of the shell program called by os.system().

You'd probably do better to use the `subprocess` module instead:
http://docs.python.org/library/subprocess.html

Cheers,
Chris
--
http://blog.rebertia.com



More information about the Python-list mailing list