Controlling an external program with Python

Grant Edwards ge at nowhere.none
Thu Jun 29 14:55:26 EDT 2000


In article <39588741.FB7EB5FE at hursley.ibm.com>, Paul Duffin wrote:
>Donn Cave wrote:
>> 
>> Quoth ge at nowhere.none (Grant Edwards):
>> | 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.
>
>I think that you will find that Expect offers a lot more than a simple 
>pipe to the executable.

Yes, I know. That's where the "roll-your-own" bit comes in. If
all you _want_ is a simple pipe to the executable, then expect
isn't really the right choice.

-- 
Grant Edwards                   grante             Yow!  BARBARA STANWYCK
                                  at               makes me nervous!!
                               visi.com            



More information about the Python-list mailing list