title: How do I get a string out from a textbox in Python?
body: <p>I wonder if it is possible to make the text in a text box converted to a variable(/string).
  I am using Python 3.3.5 and I have seen a lots of Entrybox to variable but it did not work on a textbox.<br>
  Here is the code I am working with:</p>
  
  <pre><code>from tkinter import *
  
      main = Tk()
      sr=Scrollbar(main)
      a="Hello!"
  
      txtBox = Text(main, width=20, height=5)
      sr.pack(side=RIGHT)
      txtBox.pack(side=LEFT)
      sr.config(command=txtBox.yview)
      txtBox.config(yscrollcommand=sr.set)
      txtBox.insert(END, a)
  
      def callback():
          #here is the text converted to a variabel#
  
      def closewindow():
          exit()
  
      def save():
          key = #variabel#
          f = open("key.txt", "w")
          f.write(key)
          f.close()
          print(txtBox.get()+(" /has bin saved."))
  
      button_dsp = Button(main, text="display text", width=10, command=callback)
      button_dsp.pack()
  
      button_save = Button(main, text="Save", width=10, command=save)
      button_save.pack()
  
      button_exit = Button(main, text="Exit", width=10, command=closewindow)
      button_exit.pack()
      mainloop()
  </code></pre>