title: Python: How to get input from console while an infinite loop is running?
body: <p>I'm trying to write a simple Python IRC client. So far I can read data, and I can send data back to the client if it automated. I'm getting the data in a <code>while True</code>, which means that I cannot enter text while at the same time reading data. How can I enter text in the console, that only gets sent when I press enter, while at the same time running an infinite loop?</p>
  
  <p>Basic code structure:</p>
  
  <pre><code>while True:
      read data
      #here is where I want to write data only if it contains '/r' in it
  </code></pre>