Controlling an external program with Python

Paul Duffin pduffin at hursley.ibm.com
Thu Jun 29 07:28:17 EDT 2000


Alexandre Ferrieux wrote:
> 
> Paul Duffin wrote:
> >
> > Apparently there is a port of Expect for Python so why not use that
> > rather than try and reimplement it all over again.
> > Expect has over 7 years of development and centuries of testing on many
> > different platforms, do you really want to reproduce that. If so why,
> > what exactly is wrong with Expect.
> 
> The same as with TkInter: it needs a full Tcl inside. Again I've got
> next to nothing against Tcl, it's just that the separation of orthogonal
> things is such a natural thing for me.
> 

I agree which is why I suggested that rather than rewrite Expect in Python
which is no more *orthogonal* than Expect in Tcl why not do as I suggested
and work with Don Libes on seperating the pseudo tty control stuff into
a seperate library which both Tcl and Python can use. Everyone would
gain and noone would lose, the same could be done for Tk.

      +-----------+    +----------+
      | TclExpect |    | PyExpect |
      +-----------+    +----------+

       +------------------------+
       |  Pseudo TTY management |
       +------------------------+

The above structure is much more *orthogonal* than the following structures.
   
  +--------TclExpect-------+  +--------PyExpect--------+
  |                        |  |                        |
  |  Pseudo TTY management |  |  Pseudo TTY management |
  |                        |  |                        |
  +------------------------+  +------------------------+

  +----------PyExpect----------+
  | +--------TclExpect-------+ |
  | |                        | |
  | |  Pseudo TTY management | |
  | |                        | |
  | +------------------------+ |
  +----------------------------+

This sort of arrangement is only possible when people who are interested in
Expect functionality can transcend any language *issues*, by accepting that 
the language is basically irrelevant apart from the effect in may have on
the required functionality and work together.



More information about the Python-list mailing list