I am a absolutly beginner in Tkinter and I need already help: I wanted to open a file with a button. I found everywhere this very simple example:
from Tkinter import *
from tkFileDialog import askopenfilename
def callback():
name= askopenfilename()
print name
errmsg = 'Error!'
Button(text='File Open', command=callback).pack(fill=X)
mainloop()
But how can I call now the variable "name" from the function callback? I need this variable outside of this function! Of course, I can also open the file also in the callback function, but I need the opened file to save the content in an array and work with the array...