Doubt regarding exec function

Diez B. Roggisch deetsNOSPAM at
Tue Mar 22 14:45:01 CET 2005

Mosas wrote:

> Dear All,
>      Php has exec function to run system commands and
> this function return last line of system command
> result.  But in Python I can see only os.system()
> function to run system command but it doesn't return
> any result like php exec function.
>      I want to know about php equivalent exec function
> in Python.
>      So If anyone know regarding this Kindly Mail me.
> with regards
> prabahar

os.popen or the popen2 module are what you are looking for. In python2.4
there is also subprocess I believe.


Diez B. Roggisch

More information about the Python-list mailing list