title: Python Tkinter Button/Entry combination
body: <p>I've been experimenting with Tkinter, and I have a set-up where I have an entry box and then below it two buttons (Close and OK). When close is clicked, the frame is destroyed. I want it to return whatever is in the entry box at the time and then destroy the frame. I am just at a loss for how to do this.</p>
  
  <p>This is a portion of what I have (where <code>f</code> is my frame):</p>
  
  <pre><code>class App:
      def DoThis(self):
          #Earlier code that's not related to the question
          v=StringVar()
          e=Entry(f,textvariable=v)
          buttonA=Button(f,text="Cancel",command=root.destroy)
          buttonB=Button(f,text="OK")
  </code></pre>
  
  <p>Also, please note that I want to RETURN the string to the calling function, not just immediately print it.</p>
  
  <p>I want:</p>
  
  <pre><code>print App().DoThis() #to print what was in the entry box
  #at the time of OK being clicked
  </code></pre>