Python search folder and make a Dictionary
<p>I need to make a Dictionary out of some folder hierachy.</p>

<p>I have a folder in /home/Desktop/songs --- inside there are   Folder: "A" and another "B". Inside of folder A and B there are folder: "1" and "2"</p>

<p>I want to get the FOLDERS inside "songs" and get the folders inside A and B .
Then make a Dictionary with them. Like THIS:</p>

<pre><code>A={'1','2'}
B={'1','2'}
</code></pre>

<p>That way,  If I update my folders the script gets updated.</p>

<p>I started looking to something like this:</p>

<pre><code>os.chdir('/home/Desktop/songs')
letter = [d for d in os.listdir('.') if os.path.isdir(d)]
print letter
-----&gt; A,B
</code></pre>

<p>But I dont know how to  append them  in a dictionary.</p>
