473,385 Members | 1,192 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Sending Through ^] Through telnetlib

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

Jul 18 '05 #1
2 1361

"John Abel" <jo*******@pa.press.net> wrote in message
news:ma**************************************@pyth on.org...
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.


Are you sure that just calling close() isn't what you want?
It would be unusual to send ^]quit on the wire.
Jul 18 '05 #2
jr
Try sending: '\x1d'

HTH
-jr

"John Abel" <jo*******@pa.press.net> wrote in message news:ma**************************************@pyth on.org...
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

Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: walala | last post by:
Dear all, I recently came across a Python program which used "telnetlib" to automate things in the several unix machines in our local networks; I attached the script as follows; I wonder if...
1
by: ÕÅÖ¾Ã÷ | last post by:
code below cannt work import getpass import sys import telnetlib import select tn = telnetlib.Telnet() print tn.open("162.105.31.222",23)
1
by: Stephen Ferg | last post by:
I'm trying to use telnetlib to run a Java program on a remote server. I'm having strange problems, and I'm wondering if anyone might be able to help. I have two UNIX servers, A and Z. I have...
3
by: Mike Monaghan | last post by:
I'm rather new to python but a long time programmer. I think I've covered my bases so I hope this isn't somthing obvious. I'm running ActiveState PythonWin 2.3.2 (#49, Nov 13 2003, 10:34:54) ...
3
by: Svha | last post by:
Greetings I'd like to do some tweaks on a telnet session as I have no control over the server side what so ever. However I cannot correctly negotiate a telnet connection to the server. I've...
4
by: praba kar | last post by:
Dear All, Normally we can send mail using telnet in linux. In the following way telnet Ipaddress 25 mail from: raj@rajkumar.com 250 o.k(response of from commandline) rcpt to: test@oops.co.in...
3
by: Wojciech Halicki-Piszko | last post by:
How to know if connection is active after telnetlib.Telnet.open(host,port)?
4
by: vercingetorix52 | last post by:
I'm trying to use a python script to access an embedded computer running linux and connected via a crossover ethernet cable using the following script... ....and I realize the username and...
3
by: Phoe6 | last post by:
Hi All, I am trying to use the telnetlib module. Manually when I do telnet 172.31.128.244 I get: Login: (I type root) Password: ( I type Password) And it enters to the Telnet Session:
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.