Expect like syntax in Python

Donn Cave donn at drizzle.com
Sun Feb 3 14:51:59 EST 2002


Quoth "Guy Gascoigne - Piggford" <guy at wyrdrune.com>:
| Actually I did look at them, one of them seemed somewhat limited for what I
| needed and the other uses an external expect library for functionality.
| What I want need has to execute under jython - so I can extend it in java
| but not C (at least easily).
|
| So that leaves me with my original syntax question.

Which I missed, but when I had thoughts like that once upon a time,
the best I could think of was to use the exception mechanism.  Or
abuse it, if you like.  Make pattern objects, feed them to the expect
parser in a try block, which would raise it as an exception to dispatch
to the appropriate except block.  Horrible.

But you must have support for pseudotty devices, which is a low level
functionality that is not so portable.  To my knowledge available only
on UNIX and similar platforms, and not on all such for Python.  Have
that in Java?  I don't know, but if not, you're sunk.

	Donn Cave, donn at drizzle.com



More information about the Python-list mailing list