I have a list of filenames and want to print them as a directory tree:
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']]]
i tried different ways but i cannot get further than having something like this:
['foo/bar': ['Bla', 'Foo'], 'foo/foo/': ['Bsdf'], 'xsd/sdafd' : ['saasf']]
or similar...