Discussion:
[Tkinter-discuss] select multiple folders/ directories
Cameron Laird
2011-01-13 16:24:36 UTC
Permalink
Hi,

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?

Thank you in advance

Regards,
Sujay Kher
--
View this message in context: http://old.nabble.com/select-multiple-folders--directories-tp30658702p30658702.html
Sent from the Python - tkinter-discuss mailing list archive at Nabble.com.
Wayne Werner
2011-01-13 16:36:11 UTC
Permalink
Post by Cameron Laird
Hi,
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?
dirs = []
title = 'Choose Directory'
while True:
dir = tkFileDialog.askdirectory(title=title)
if not dir:
break
title = 'got %s. Next dir' % dirs[-1]

Probably not the most elegant solution, but hopefully it helps.

Wayne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tkinter-discuss/attachments/20110113/42dcf1da/attachment.html>
Sujay
2011-01-13 17:05:30 UTC
Permalink
Thank you Wayne,

I really appreciate your swift response.

I have solve this problem by using wxpython.

Now I am stuck in another problem. I can not select directory from network.
Dialogue only shows directory of my local system.

In short, i cant access NETWORK in this multidirdialog.. its just based on
local file system access.

do u have any idea how i can tweek this?? work around?

Best regards,

Sujay Kher
Post by Wayne Werner
Post by Cameron Laird
Hi,
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?
dirs = []
title = 'Choose Directory'
dir = tkFileDialog.askdirectory(title=title)
break
title = 'got %s. Next dir' % dirs[-1]
Probably not the most elegant solution, but hopefully it helps.
Wayne
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss at python.org
http://mail.python.org/mailman/listinfo/tkinter-discuss
--
View this message in context: http://old.nabble.com/select-multiple-folders--directories-tp30663726p30664142.html
Sent from the Python - tkinter-discuss mailing list archive at Nabble.com.
Continue reading on narkive:
Loading...