kbhit/getch python equivalent

Chris Angelico rosuav at gmail.com
Mon Apr 22 11:08:21 EDT 2013


On Mon, Apr 22, 2013 at 11:34 PM, alb <alessandro.basili at cern.ch> wrote:
> I'm looking for a kbhit/getch equivalent in python in order to be able
> to stop my inner loop in a controlled way (communication with external
> hardware is involved and breaking it abruptly may cause unwanted errors
> on the protocol).

Catch KeyboardInterrupt and hit Ctrl-C.

ChrisA



More information about the Python-list mailing list