title: python key press to interrupt time.sleep()
body: <p>I have a program that spends a lot of time asleep in an endless loop, it checks in with another system API every 6 hours, and if there are changes does some stuff, if not goes back to sleep.</p>
  
  <p>Without listing all the code, its pretty simple; I have </p>
  
  <pre><code>while True:
      do some stuff
      time.sleep(21600)
  </code></pre>
  
  <p>The only way to break this is with CTRL+C, but that seems ugly, is there a way to make another keypess interrupt the time.sleep() and use a graceful sys.exit()?</p>