title: Passing a variable from Tkinter to main program
body: <p>Maybe this is easy, but I just don't figure it out ...</p>
  
  <p>In the code below the "File Open" Button saves the filename to "name" -- but  how can I access this variable outside of Tkinter? A return statement in "callback", but how would I access that since callback is inside the "Button" command?</p>
  
  <pre><code>from Tkinter import *
  from tkFileDialog   import askopenfilename      
  
  def callback():
      name= askopenfilename() 
      print name
  
  Button(text='File Open', command=callback).pack(fill=X)
  mainloop()
  
  #HOW DO I ACCESS FILENAME AFTER MAINLOOP?
  name = ????
  </code></pre>