R
rom
Hi there,
I am writing an interface with Tkinter. My minimal program looks like
this:
#############
import Tkinter
import tkFileDialog
root = Tkinter.Tk()
Tkinter.Button(root, text='Notch genes...', command=lambda:
open_file_dialog()).pack()
def open_file_dialog():
filename = tkFileDialog.askopenfilename(filetypes=[("all
files","*")])
# print filename
root.mainloop()
#############
I would like to recover the filename variable outside the
"open_file_dialog" function. For instance, to be able to print the
selected file name (uncomment "# print filename" line).
Is there a way to do that?
Thanks in advance.
R
I am writing an interface with Tkinter. My minimal program looks like
this:
#############
import Tkinter
import tkFileDialog
root = Tkinter.Tk()
Tkinter.Button(root, text='Notch genes...', command=lambda:
open_file_dialog()).pack()
def open_file_dialog():
filename = tkFileDialog.askopenfilename(filetypes=[("all
files","*")])
# print filename
root.mainloop()
#############
I would like to recover the filename variable outside the
"open_file_dialog" function. For instance, to be able to print the
selected file name (uncomment "# print filename" line).
Is there a way to do that?
Thanks in advance.
R