title: Python - Infinite while loop, break on user input
body: <p>I have an infinite while loop that I want to break out of when the user presses a key. Usually I use <code>raw_input</code> to get the user's response; however, I need <code>raw_input</code> to not wait for the response. I want something like this:</p>
  
  <pre><code>print 'Press enter to continue.'
  while True:
      # Do stuff
      #
      # User pressed enter, break out of loop
  </code></pre>
  
  <p>This should be a simple, but I can't seem to figure it out. I'm leaning towards a solution using threading, but I would rather not have to do that. How can I accomplish this?</p>