title: python using a thread in an infinite loop
body: <p>How can I use threading in order to run 2 processes simultaneously infinitely? I have a chat program, and I want to input while having stuff print out. </p>
  
  <p>I have done a bit of research into thread, and it seems really complicated. What I have so far is</p>
  
  <pre><code>t = Thread(target=refresh)    
  t.daemon = True
  t.start()
  </code></pre>
  
  <p>I have a refresh() function.</p>
  
  <p>But I'm pretty sure this is wrong, and I have no idea how to run this infinitely alongside my input. Can someone explain how threading works, and how I can run it infinitely alongside another infinite loop?</p>