Controlling an external program with Python

Grant Edwards ge at nowhere.none
Sat Jun 24 16:08:51 EDT 2000


In article <kuzoobue0g.fsf at lasipalatsi.fi>, Erno Kuusela wrote:
>>>>>> "Tony" == Tony Keating <keating at mech.uq.edu.au> writes:
>
>    Tony> start the program, then send various strings to the program,
>    Tony> read some output from the program then send some more
>    Tony> strings to the program.
>
>there are a couple of expect modules for python (so named because
>there is an old tcl-based language called expect for doing just this).
>parnassus lists 3 modules (<URL:http://www.vex.net/parnassus/
>apyllo.py?find=expect>), i haven't
>used any of them however...

Or you can roll your own using the popen2 module.

-- 
Grant Edwards                   grante             Yow!  hubub, hubub, HUBUB,
                                  at               hubub, hubub, hubub, HUBUB,
                               visi.com            hubub, hubub, hubub.



More information about the Python-list mailing list