expect module and/or functionality? Or SSH wrapper module?

Lance Ellinghaus lellinghaus at yahoo.com
Wed Jul 10 11:24:10 EDT 2002


See my comments below...

--- Cameron Laird <claird at starbase.neosoft.com> wrote:
> In article <lksn2rx3ni.fsf at pc150.maths.bris.ac.uk>,
> Michael Hudson  <mwh at python.net> wrote:
> >claird at starbase.neosoft.com (Cameron Laird) writes:
> >
> >> If not, no, you can't Expect with pure Python; there's no
> >> practical way to get the pseudoterminal munging right without
> >> calls into the C run-time library that Python itself can't
> >> access.
> >
> >Huh?  You have openpty, forkpty, ioctl, setsid, setpgrp, ... what
> more
> >do you want?
> 			.
> 			.
> 			.
> World peace.  I'm concluding my counsel was ill-advised;
> maybe people shouldn't be listening to me.  As of 2.2,
> (now-deprecated) pty was still the distribution module,
> not openpty or forkpty.  I fear that my pettiness came
> across as a reflection on the great work done by Lance
> Ellinghaus, Thomas Wouters, and others on these modules.
> This would be an injustice.  I overreacted to early re-
> leases that didn't work smoothly for other-than-Linux,
> and/or were not installed by default.
> 
> I do want to emphasize the distinction between the modules
> you've listed above and, for example, PySSH, which operates
> at a higher level, as does Expect, also.  As a programming
> interface, openpty, forkpty, and so on are rather Unix-
> centric.

Thank you for the compliment!

It is true that many Non-Linux systems do not provide the necessary
functions to make it work easily. Solaris does not include openpty()
and forkpty(). This makes it difficult to create a true Expect library
in Python. I added this functionality to the posix module and submitted
the diffs to the Python Dev group (and promptly got screamed at by
someone there for posting it there) and have also now posted it to the
Patches page on sourceforge. Maybe it will someday get rolled into the
distribution, and until then you can grab it from there.

There is a person on this list that has a Python module that works like
Expect and is not reliant on Tcl. It is not PySSH (it does not work). I
have been using his module for about 1 month now and it works GREAT
(even with SSH passwords). He has told me he will release it to this
list soon...

Lance Ellinghaus


=====
--
Lance Ellinghaus

__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com





More information about the Python-list mailing list