Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #35126

Re: Telnetlib and special quit characters with Ctrl, oh my!

References <ea807804-c082-44d0-9165-226545e097a5@googlegroups.com>
Date 2012-12-20 01:57 +1100
Subject Re: Telnetlib and special quit characters with Ctrl, oh my!
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1052.1355929054.29569.python-list@python.org> (permalink)

Show all headers | View raw


On Thu, Dec 20, 2012 at 1:28 AM,  <winona_whitener@yahoo.com> wrote:
> I am using telnetlib and the box that I'm connecting to has a special escape sequence--^]--to leave the prompt and go back to the regular telnet prompt.  For example, from teh command line I do this:
> ...
> When I pressing and hold Ctrl and then ], I go back to my normal telnet prompt and can quit.
>
> Using telnetlib, I can send commands and get responses.  But I'm stuck on sending the ctrl+]!  Is there some escape character--\c?--or a keycode like \^ to send through telnetlib?

The ctrl-] keystroke doesn't get sent down the wire, it's commands to
the _local_ telnet. For instance, if your session has stalled, you can
enter "^]close" to immediately disconnect. There won't be a direct way
to drop to "command mode" inside telnetlib, but you can do similar
actions with methods on the connection object (in that instance,
close() will do the job).

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Telnetlib and special quit characters with Ctrl, oh my! winona_whitener@yahoo.com - 2012-12-19 06:28 -0800
  Re: Telnetlib and special quit characters with Ctrl, oh my! Chris Angelico <rosuav@gmail.com> - 2012-12-20 01:57 +1100

csiph-web