Improving telnetlib

Jean-Paul Calderone exarkun at divmod.com
Wed Oct 4 11:15:54 EDT 2006


On Wed, 4 Oct 2006 11:19:35 +0100, Matthew Warren <matthew.warren at digica.com> wrote:
>
>Hi,
>
>I use telnetlib in an app I am writing, and would like to add
>functionality to it to support interactive terminal sessions , IE: be
>able to 'vi' a file.
>
>Currently it seems telnetlib isnt quite sophisticated enoguh to support
>such a thing.
>
>The trouble is, I havent got a clue where to start and would appreciate
>a couple of pointers to get me going...
>

I'd suggest taking a look at Twisted, which contains a more complete
telnet implementation (not as important for being able to launch vi),
an ssh implementation (which you might want to use instead of telnet),
a VT102 implementation (which is actually what will help you run programs
that want to fiddle around with the cursor in fancy ways), as well as a
fair amount of work towards a simple terminal emulator (to help you keep
track of what vi has done to your virtual terminal).

API docs for insults:

http://twistedmatrix.com/documents/current/api/twisted.conch.insults.html

And for the telnet implementation:

http://twistedmatrix.com/documents/current/api/twisted.conch.telnet.html

Jean-Paul



More information about the Python-list mailing list