Answer the question
In order to leave comments, you need to log in
How to teach Python to recognize ESC sequences (in particular, pressing arrows) and not print their code, but do what is intended?
Good day!
I'm writing a small console utility that will run mostly on Linux machines.
The question arose: how to teach Python to recognize ESC sequences (in particular, pressing arrows) and not display their code, but do what is intended.
For example, pressing the left key prints the corresponding ESC sequence instead of moving the cursor:
Type any symbol to break input: ^[[D
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question