title: Redirecting IDLE output to a GUI (Python33)
body: <p>Is there a way to redirect all IDLE output to a tkinter GUI, or do something with the IDLE outputs? I want to show all IDLE output from the <code>http.server</code> module in a tkinter GUI, to monitor all things happening to a webserver. Is this doable with a few simple functions/commands or will this involve editing the IDLE lib files?</p>
  
  <p>Asked something similair before, I wanted to embed the whole IDLE/python shell in my monitoring program, but this seems impossible with the newest python version.</p>
  
  <p>EDIT:</p>
  
  <pre><code>from tkinter import *
  import sys, time, threading
  global TXT
  root = Tk()
  TXT = Text(root, font="Arial")
  TXT.pack(fill=X)
  
  class RedirectText(object):
  
      def __init__(self, TXT):
          self.out = TXT
  
      def write(self, string):
          TXT.insert(END, string)
  sys.stdout = RedirectText(TXT)
  
  for i in range(10):
      print("test", i+1)
  
  def thread():
      print("Delayed")
      threading.Timer(1, thread).start()
  
  threading.Timer(1, thread).start()
  root.mainloop()
  </code></pre>
  
  <p><strong>Removed all faulty code, now have this. Will not write anything system related, just what is inside a <code>print()</code> function. Still looking for a way to <code>insert</code> all system output into a text widget.</strong></p>