title: how to pass the text entered in entry box in tkinter from one function to another?
body: <p>I m tying to pass the entery box text from one function to another but it gives me error that the variable itself is not defined.Here is my code.</p>
  
  <pre><code>from Tkinter import *
  def mhello():
      mtext=ment.get()
      print mtext
  def main():
      root=Tk()
      ment=StringVar()
      root.title('Test')
      mlabel=Label(root,text='Enter Text').pack()
      mentry=Entry(root,textvariable=ment).pack() 
      mbutton=Button(root,text='Click Me',command=mhello).pack()
  if __name__ == '__main__':
      main()
  </code></pre>
  
  <p>it gives the error as:</p>
  
  <pre><code>Exception in Tkinter callback
  Traceback (most recent call last):
  File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in __call__
  return self.func(*args)
  File "pygui.py", line 3, in mhello
  mtext=ment.get() 
  NameError: global name 'ment' is not defined
  </code></pre>