I can press keys or send text using following method:
tn.write(b"4\n")
How would I do it for UP, DOWN and other arrow keys?
I can press keys or send text using following method:
tn.write(b"4\n")
How would I do it for UP, DOWN and other arrow keys?
Possible duplicate of How do I send telnetlib control + c command in python
following worked for me:
# up
tn.write(b"\x1B\x5B\x41\n")
# down
tn.write(b"\x1B\x5B\x42\n")
# left
tn.write(b"\x1B\x5B\x43\n")
# right
tn.write(b"\x1B\x5B\x44\n")