Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > RE: Sending Through ^] Through telnetlib

Thread Tools

RE: Sending Through ^] Through telnetlib

Mahrt, Dallas
Posts: n/a

> "John Abel" <(E-Mail Removed)> wrote in message
> news:mailman.687.1074866920.12720.python-> Removed)...
> >

> I have written a script that makes a
> telnet connection, runs various
> > commands, and returns the output. That was the easy bit

> However, to
> > close the session, I need to send ^] followed by quit. I've tried
> > sending chr(29), which is the ascii equivalent, but that

> doesn't seem to
> > work. Is there something I'm missing?
> >
> > Any pointers would be much appreciated.
> >
> > Thanks
> >
> > J
> >


FYI the telnetlib (as of 2.2.1, not sure past that) does not support all
telenet commands. If you want to send a special command, you need to access
the raw socket and send the extened options list character and the command

Ex: to send a Telnet BREAK


So maybe trying

Will work fo you?

Dallas S. Mahrt>

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
telnetlib close not closing sockets Mike Monaghan Python 4 10-07-2004 01:01 AM
Need help with telnetlib flakiness Stephen Ferg Python 1 02-06-2004 01:59 AM
Sending Through ^] Through telnetlib John Abel Python 2 01-23-2004 05:47 PM
quest about telnetlib =?gb2312?B?1cXWvsP3?= Python 1 11-13-2003 11:28 PM
any telnetlib equivalent in Python for rlogin? walala Python 2 11-12-2003 02:40 PM