Created
October 15, 2013 19:27
-
-
Save chiwanpark/6997265 to your computer and use it in GitHub Desktop.
Keyboard Interrupt Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while True: | |
try: | |
print "hi" | |
except KeyboardInterrupt: | |
print "bye" | |
import sys | |
sys.exit(0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment