title: Convert a list of filenames into tree like dict
body: <p>I have a list of filenames and want to print them as a directory tree:</p>
  
  <pre><code>files = ["foo/bar/Bla", "foo/bar/Foo", "foo/foo/Bsdf", "xsd/sdafd/saasf"]
  [...]
  # output should look like this 
  output = ['foo' : ['bar' : ['Bla', 'Foo'], 'foo' : ['Bsdf']], 'xsd' : ['sdafd' : ['saasf']]]
  </code></pre>
  
  <p>i tried different ways but i cannot get further than having something like this:</p>
  
  <pre><code>['foo/bar': ['Bla', 'Foo'], 'foo/foo/': ['Bsdf'], 'xsd/sdafd' : ['saasf']]
  </code></pre>
  
  <p>or similar...</p>