Python newbie at time of writing.
This came up because I want a user to be able to select a group of files from within a directory (and also any subdirectory), and unfortunately Tkinter’s default ability for selecting multiple files in a file dialog is broken on Windows 7 (http://bugs.python.org/issue8010).
So I am attempting to represent a directory structure by an alternative method (still using Tkinter): constructing a facsimile of the directory structure, made of labeled and indented checkboxes (organized in a tree). So a directory like this:
\SomeRootDirectory
\foo.txt
\bar.txt
\Stories
\Horror
\scary.txt
\Trash
\notscary.txt
\Cyberpunk
\Poems
\doyoureadme.txt
will look something like this (where # represents a checkbutton):
SomeRootDirectory
# foo.txt
# bar.txt
Stories
Horror
# scary.txt
Trash
# notscary.txt
Cyberpunk
Poems
# doyoureadme.txt
Building the original dictionary from the directory structure is easy using a certain recipe I found at ActiveState (see below), but I hit a wall when I try to iterate over the nicely nested dictionary I am left with.
This is a preliminary code. Go through it and tell me where you face problems.