Search code examples
pythonblessed

echo input character using blessed and cbreak


Writing a python script, I use blessed module to input a single character without having to press on Enter key. Unfortunately, the character input is not echoed

term = Terminal()

with term.cbreak(): 
   key= term.inkey()
....

Is there a way to get input character echoed ? Thanks !


Solution

  • Well, no magic answer :-) I guess I'll just add a print(key) after each inkey() call