Tkinter, tkFileDialog - how to select multiple files ?

Steve Offutt stevescripts at gmail.com
Tue Apr 7 20:36:53 CEST 2009


Let me preface by saying that I don't do much Python, however, I am in
my spare time, attempting to become somewhat comfortable with Python/
Tkinter.

I just can't seem to understand what is the problem with this:

------
import Tkinter, tkFileDialog

root = Tkinter.Tk()

files = tkFileDialog.askopenfilenames(parent = root, filetypes =
[('JPEG', '*.jpg'), ('ICON', '*.ico'), ('GIF', '*.gif')], title =
"Select files...", multiple = 1 )

print files
-----

Any help greatly appreciated!

Steve



More information about the Python-list mailing list