Skip to content

Instantly share code, notes, and snippets.

@robgolding
Created February 5, 2015 16:23
Show Gist options
  • Save robgolding/f9bede606009cadceb57 to your computer and use it in GitHub Desktop.
Save robgolding/f9bede606009cadceb57 to your computer and use it in GitHub Desktop.
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