1

I automate testing of terminal application running in links browser on remote server. Here I need to send press of an arrow key.

Solution from How to send an arrow key use paramiko library in python? (sending f.e. '\e[B' for arrow down) obviously don't work in Python 3.

Is there a way? Thanks.

mmichalik
  • 64
  • 1
  • 6

1 Answers1

1

Got it, should send:

KEY_UP = b'\x1b[A'
KEY_DOWN = b'\x1b[B'
KEY_RIGHT = b'\x1b[C'
KEY_LEFT = b'\x1b[D'

It works, but it cannot be converted to (python3 default multibyte) string before sending.

mmichalik
  • 64
  • 1
  • 6