title: Get user input from Entry (Tkinter) on click of Button
body: <p>Code objective: to get User data on click of Button using Tkinter and 
  Code as follows:</p>
  
  <pre><code>class myClass:
  
      def OnClick():
          userData = entry.get()
          root.destroy()
          return userData
  
      def myFunction()
          &lt;My code which creates GUI&gt;
          button = Button (app, text="Submit", command=OnClick)
          button.grid()
          root.focus_set()
          root.mainloop()
          return userData
  
  
  Object = myClass()
  GetUserData = Object.myFunction()
  print GetUserData
  </code></pre>
  
  <p>As user Enters a number on GUI and Clicks on Button, <code>OnClick()</code> function should return that value to <code>myFunction()</code> then it should return for <code>GetUserData</code>, but this code is not working as my objective.</p>