My python try/except loop does not seem to trigger a keyboard interrupt when Ctrl + C is pressed while debugging my code in pycharm. My code look like this:
Here is working normally, since i put a variable "x" in your code and i use tabs instead spaces.
try: def help(): print("Help.") def doStuff(): print("Doing Stuff") while True: x = int(input()) if x == 1: help() elif x == 2: doStuff() else: exit() except KeyboardInterrupt: exit()