pty.py: any example code out there?

Andrew MacIntyre andymac at bullseye.apana.org.au
Tue Jul 18 07:26:33 EDT 2000


On Tue, 18 Jul 2000, David Goodger wrote:

> I'm looking for some concrete examples of the use of pty.py or any
> equivalent. I've written a wrapper for the passwd program on QNX (a
> POSIX-compliant realtime OS), and passwd is reluctant to be wrapped, writing
> directly to the console/tty/pty, bypassing stdin/out. My wrapper currently
> uses telnetlib.py to do its dirty work, but it's a kludgey solution. Any
> samples, examples, pointers, hints or tips out there? Thanks in advance!

I tried using expectmodule, which includes pty support, for this sort of
thing on Solaris without success :-(.  I ended up using it (expectmodule) 
to telnet to localhost to get it to run passwd.

I'd be interested in any other solutions you come up with.

--
Andrew I MacIntyre                     "These thoughts are mine alone..."
E-mail: andrew.macintyre at aba.gov.au    (work) | Snail: PO Box 370
        andymac at bullseye.apana.org.au  (play) |        Belconnen  ACT  2616
        andymac at pcug.org.au           (play2) |        Australia





More information about the Python-list mailing list