Doubt regarding exec function

Diez B. Roggisch deetsNOSPAM at web.de
Tue Mar 22 08:45:01 EST 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.

-- 
Regards,

Diez B. Roggisch



More information about the Python-list mailing list