title: Walking/iterating over a nested dictionary of arbitrary depth (the dictionary represents a directory tree)
body: <p>Python newbie at time of writing.</p>
  <p>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 (<a href="http://bugs.python.org/issue8010" rel="nofollow noreferrer">http://bugs.python.org/issue8010</a>).</p>
  <p>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:</p>
  <pre><code>\SomeRootDirectory
      \foo.txt
      \bar.txt
      \Stories
          \Horror
              \scary.txt
              \Trash
                  \notscary.txt
          \Cyberpunk
      \Poems
          \doyoureadme.txt
  </code></pre>
  <p>will look something like this (where # represents a checkbutton):</p>
  <pre><code>SomeRootDirectory
      # foo.txt
      # bar.txt
      Stories
          Horror
              # scary.txt
              Trash
                  # notscary.txt
          Cyberpunk
      Poems
          # doyoureadme.txt
  </code></pre>
  <p>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.</p>