title: I'm trying to create a tkinter output window for a text based application
body: <p>I have a script that continually takes in text and outputs text (its a text based game)</p>
  
  <p>I would like to run it through a tkinter GUI as opposed to the console</p>
  
  <p><a href="https://stackoverflow.com/questions/12351786/python-converting-cli-to-gui">Python : Converting CLI to GUI</a></p>
  
  <p>This question perfectly answers how to convert "print" into a GUI insert.</p>
  
  <p>The problem is that my game obviously runs through a ton of loops, and that screws up the "app.mainloop()" because it either never runs (and then the GUI never shows up) or you run it first, and it doesn't let anything else run.</p>
  
  <p>I suppose I could try and and stagger these loops somehow, but that seems very hackish. I could also try to modify my entire codebase to run inside the app.mainloop(), but what I really think I need is multiple threads. Problem is, I have no idea how to make that work. </p>
  
  <p>There are a few other questions, but they either don't work or don't make much sense:
  <a href="https://stackoverflow.com/questions/32168871/tkinter-with-multiple-threads">Tkinter with multiple threads</a></p>
  
  <p><a href="https://stackoverflow.com/questions/30410421/run-process-with-realtime-output-to-a-tkinter-gui">Run process with realtime output to a Tkinter GUI</a></p>
  
  <p>Thanks.</p>
  
  <p>Edit: extremely simplified code:</p>
  
  <pre><code>def moveNorth():
      print('You have moved north')
  
  def interpreter(command):
      if command == 'go north':
           moveNorth()
      else:
           print('invalid command')
  
  def listener():
       playerchoice = sys.stdin.readline().strip()
       return playerchoice
  
  if __name__ == '__main__':
      print('Welcome')
      while playing:
          interpreter(listener())
  </code></pre>