title: How should I be going about exiting python script when user types 'q'?
body: <p>I'm trying to add code to exit my curses python script correctly when the user types <code>q</code>. I can't merely do <code>CTRL+C</code> because then curses won't be de-initialized correctly.</p>
  
  <p>I haven't found a good solution with getting user input that has a timeout so the program doesn't sit there until the user gives some input. </p>
  
  <p>Is there a simple way with creating a second thread that just handles user input and can request the main thread to run a de-init function?</p>