473,326 Members | 2,813 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,326 software developers and data experts.

Problems flushing output over Telnet Session

I'm currently running Python 2.5 on Windows 2003. I'm not sure if this is strictly a python issue but I was wondering if anyone has seen and/or knows how to fix this problem.

From a linux system using an xterm terminal type, I telnet into the Windows box and execute 'python script.py'. script.py is simply a script that takes in user input using raw_input("prompt: ") and prints what the user inputted onto the screen. However the prompt doesn't get printed onto the screen.

I suspected the issue was with flushing the ouptut so I've tried the following hack:

print "prompt: "
sys.stdout.flush()
raw_input("").

This works fine for this case, but I also in the future want to get tab completion to work and the above code will not issue a re-prompt when the user presses tab as the prompt value in raw_input is "".

I then tried the -u option in python and this is also giving me funny formatting with newlines and such.

Lastly, I've tried changing the terminal type of the telnet client to vt100 and it seems to work okay. However, I don't want to require someone to change their terminal type to get this to work.

Does anyone know of a good solution for this? And also perhaps explain what's going on?

Thanks!
Apr 3 '07 #1
0 1916

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: kumar | last post by:
Hi all, I want to write a telnet server for an embedded linux box using python.The problem is that it doesn't give a shell ( just a limited CLI commands for configuring it . )My requirement is...
4
by: Donnal Walter | last post by:
On Windows XP I am able to connect to a remote telnet server from the command prompt using: telnet nnn.nnn.nnn.nnn 23 where nnn.nnn.nnn.nnn is the IP address of the host. But using telnetlib,...
5
by: richardtinkler | last post by:
I need to communicate with a POP3 server using ASP. Does anybody have any ideas how I can set up a telnet connection using an ASP script? There are some components out there, but my host won't...
2
by: Hoegje | last post by:
I am writing a C++ program, which should create a sub- process to start a telnet session to another server. Then it should login to that server (on the telnet login) and execute one or more...
1
by: Michael | last post by:
Dear all, Given the following challenge: 1. The application is an exe on a W2K server 2. User logs via telnet to the server 3. After checking the user account and password, a bat file runs...
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...
2
by: eight02645999 | last post by:
hi i am using a telnet session to simulate an authentication mechanism USER = "user" PASSWORD = "password" try: telnet = telnetlib.Telnet(HOST) telnet.set_debuglevel(5)...
1
by: juergen | last post by:
Hi, there are many postings on this subject, I have read them put don't have an answer. I get these warnings: Cannot send session cookie - headers already sent in, but my php-scripts are okay. ...
9
by: ravimath | last post by:
Hi all , I have written script to view some router output , my script executes successfuly , but does'nt show any output, why ?, it always shows output as 1. use Net::Telnet; use Term::ReadKey;...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.