Mr_Oz
asked on
Escape codes for function keys in a telnet session
I am connecting to a box via telnet that is running Operating System: SCO 5.07.
This telnet session is automated by a python script using the python TelnetLib library. I need to be able to send function key and arrow key presses programatically with python through the telnet session.
The key presses I need include the up down arrows, and basically F1 through F10. I have been unable to get this to work properly so my question is 2 fold.
1. How can I determine what I need to send for example an F3 key press?
2. In the python I do a telnet.write() what do I put in there to properly send the command across?
Thanks,
This telnet session is automated by a python script using the python TelnetLib library. I need to be able to send function key and arrow key presses programatically with python through the telnet session.
The key presses I need include the up down arrows, and basically F1 through F10. I have been unable to get this to work properly so my question is 2 fold.
1. How can I determine what I need to send for example an F3 key press?
2. In the python I do a telnet.write() what do I put in there to properly send the command across?
Thanks,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Also, don't forget to use an appropriate line ending, where you would hit the enter key interactively. For telnet I believe the line endings should be '\r\n' (CRLF).
ASKER
Unfortunately the box I am telneting into does not have python :( I will try some of your suggestions though.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks I think a combination of these 2 answers should get me going.