[Tkinter-discuss] select multiple folders/ directories
waynejwerner at gmail.com
Thu Jan 13 17:36:11 CET 2011
On Thu, Jan 13, 2011 at 10:24 AM, Cameron Laird <Cameron at phaseit.net> wrote:
> I'm currently using tkFileDialog.askdirectory() to select a single
> directory. I would like to be able to select multiple directories.
> tkFileDialog.askopenfilenames() seems to do this for files.
> What can I do in my situation? Are there alternative classes that
> provide file dialogs better suited for my purpose?
> I want to select multiple folders at a time but tkFileDialog.askdirectory()
> doesnt allow "multiple=1".. is there any way to make this work?
>From my quick test, there doesn't appear to be. However, you can do this:
dirs = 
title = 'Choose Directory'
dir = tkFileDialog.askdirectory(title=title)
if not dir:
title = 'got %s. Next dir' % dirs[-1]
Probably not the most elegant solution, but hopefully it helps.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tkinter-discuss