tkinter - tkFileDialog - how to get dir instead of file

maxm maxm at mxm.dk
Mon Oct 29 17:14:44 EST 2001


I am writing my first tkinter program and so far it's been pretty painless.
But now I need to open a directory and not a file. I cannot see a simple way
to get this from the standard module "tkFileDialog".

Do I really have to write a special class for this?

Regards Max M

----------------

I am following Frederik Lundhs excellent introduction at:
http://www.pythonware.com/library/tkinter/introduction/

My current code. But it can only select a file. Not a directory

#returns original directory of website
orig_file = tkFileDialog.askopenfilename(title="Find originale website")
self.entry_OriginalSite.delete(0, END)
self.entry_OriginalSite.insert(INSERT, orig_file)







More information about the Python-list mailing list