Link to home
Start Free TrialLog in
Avatar of Mr_Oz
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,
ASKER CERTIFIED SOLUTION
Avatar of LunarNRG
LunarNRG
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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).
Avatar of Mr_Oz
Mr_Oz

ASKER

Unfortunately the box I am telneting into does not have python :(  I will try some of your suggestions though.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mr_Oz

ASKER

Thanks I think a combination of these 2 answers should get me going.