Trying to run an external program

Gabriel Genellina gagsl-py at
Thu Sep 21 02:33:50 CEST 2006

At Wednesday 20/9/2006 19:49, Brant Sears wrote:

>Hi. I'm new to Python and I am trying to use the latest release (2.5)
>on Windows XP.
>What I want to do is execute a program and have the results of the
>execution assigned to a variable. According to the documentation the
>way to do this is as follows:
>import commands
>x = commands.getstatusoutput('dir')

According to the documentation:
Availability: Unix.

Try the subprocess module, which intents to replace it.

Gabriel Genellina
Softlab SRL 

Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya!

More information about the Python-list mailing list