title: Tkinter text box returning a variable
body: <p>This should be very very simple but how do I get the following basic code to output the entered variable so that I can then pass it on to the rest of the program.</p>
  
  <pre><code>from Tkinter import *
  root = Tk()
  
  InputStrings = StringVar()
  Entry(root, textvariable=InputStrings).pack()
  
  def GetString():
      print InputStrings.get()
      Button(root, text='Print', command=OutputText).pack()
      root.mainloop()
  
  def OutputText():
      OutString=InputStrings.get()
      print OutString
      root.withdraw()
      root.quit()
  
  GetString()
  print OutString
  </code></pre>
  
  <p>When I add OutString to the def it gives other errors. Do I really need the OutputText module -can't it just be returned from the GetString module?</p>