I\'m writing python 2.6.6 code on windows that looks like this:
try: dostuff() except KeyboardInterrupt: print \"Interrupted!\" except: print \"S
def foo(): try: x=0 while 1: x+=1 print (x) except KeyboardInterrupt: print ("interrupted!!") foo()
That works fine.