Created
February 5, 2015 16:23
-
-
Save robgolding/f9bede606009cadceb57 to your computer and use it in GitHub Desktop.
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
import signal | |
import time | |
def shutdown(): | |
client.stop() | |
sys.exit(0) | |
signal.signal(signal.SIGINT, shutdown) | |
try: | |
while True: | |
time.sleep(5) | |
except KeyboardInterrupt: | |
shutdown() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment