1 2 3 4 5 6 7 8 9
#! /usr/bin/python import time while True: try: print "im working!" time.sleep(0.5) except KeyboardInterrupt: print "\nexit" break