# L-28 MCS 260 Wed 30 Oct 2007 : cntrlc.py # # The following program shows the handling # of the keyboard interrupt: cntrl+c. cnt = 0 print 'hold ctrl and c to stop...' try: while True: cnt = cnt + 1 except KeyboardInterrupt: print 'counted ' , cnt