system call in python

Erik Max Francis max at alcyone.com
Thu Aug 14 02:00:39 EDT 2003


Catherine Yang wrote:

> A question about how to execute a system command from python program.
> e.g.
> in a python script, I need to run another program written in C++, and
> after
> that come back to the same python program.
> 
> Is it the system module, and which function do I use to do this?

os.system, or os.popen, or one of the popen.popen... functions if you
want to collect the output or feed it input.

-- 
   Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
 __ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
/  \ Laughter is the only genuine form of applause.
\__/  Camden Benares




More information about the Python-list mailing list