Tkinter FileDialog

Alex van der Spek zdoor at xs4all.nl
Sun May 22 16:13:07 EDT 2011


Trying to bring up a simple File or Directory chooser using Tkinter. Right 
now I use pywin32  as Mark Hammond's extensions are somewhat more familiar 
to an (ex)VB programmer who started way back with Fortran.

On Windows Vista with Python 2.7. The examples from Mark Lutz' book 
"Programming Python" do not immediately apply. The book describes Python 3.x 
only.

This is what I do (in IDLE):

import tkFileDialog as tk
file2open=tk.Open().show()

This works. But it also brings up a persistent Tk window. Killing this 
window forces a restart in IDLE, which is not desirable. There does not 
appear to be a way to multiselect files?

I am probably missing a whole lot. Please point me to a simple example of 
GUI file manipulations. I can save myself with os.path.walk and os.listdir 
but the users I try to serve cannot.

Regards,
Alex van der Spek 




More information about the Python-list mailing list