A pure Python solution that works like expect ????

Donn Cave donn at u.washington.edu
Thu May 16 11:31:16 EDT 2002


Quoth Lance Ellinghaus <lellinghaus at yahoo.com>:
|
| The PySSH library does not work when you must specify the password.
| Must I break down and use Perl for this? The Perl modules work
| correctly for this.. I just did not want to have to write it all in
| Perl.
|
| This is running on Solaris 2.8.

The key is whether you have access to the pty device, the pseudotty
that looks like a real tty to the application.  Check for posix.openpty
and posix.forkpty.  If it's there, then you can write your interface
in Python, at least in theory.  It's a far cry from Expect, but the
interface rules are going to be pretty simple and Expect might be
overkill anyway.  The main hurdle will be the quirks of the pty device.
You can look at pty.py in the library, but if it doesn't help, you don't
need it.  I'm not saying there isn't a Python Expect out there for you,
maybe there is, just that it isn't absolutely necessary.

	Donn Cave, donn at u.washington.edu



More information about the Python-list mailing list