Author: jackbot_admin

Reading keyboard input with Python

There are a number of ways to read keyboard input with python. One easy option is to use the curses library, using the getch() method, as shown below: The program above initialises the curses library, then sits in an infinite loop, printing a message whenever any keyboard buttons are pressed. Use ctrl-c to interrupt the loop and clean up curses before exiting gracefully. Note that …

Start reading Reading keyboard input with Python