Calling external program from within python

Grant Edwards grante at
Fri Jul 25 16:37:04 CEST 2008

On 2008-07-25, Diez B. Roggisch <deets at> wrote:

>> There are probably many ways to do this. I would recommend
>> checking out the subprocess module and see if it does what you
>> want.
> This will only work if the program can be fully controlled by 
> commandline arguments.

Why do you say that?   You can interact with programs via
stdin/stdout using the subprocess module.

> If interaction is required, the OP might consider using
> pexpect.

Pexpect is a good option, but it's just an automation layer on
top of the same facilities that subprocess provides.

Grant Edwards                   grante             Yow! I'm having a BIG BANG
                                  at               THEORY!!

More information about the Python-list mailing list