title: zipfile extract zip to a folder
body: <p><strong>Below is what file structure looks like</strong></p>
  
  <pre><code>music_folder
      album1.zip (below are contents inside of zip)
          song1.mp3
          song2.mp3
          song3.mp3
      album2.zip (below are contents inside of zip)
          song12.mp3
          song14.mp3
          song16.mp3
  </code></pre>
  
  <p>I want to extract both zipped albums into a directory called <code>cache</code> and I want the same structure. <strong>This is what I want it to look like:</strong></p>
  
  <pre><code>cache
      album1 (this is a normal unzipped folder)
          song1.mp3
          song2.mp3
          song3.mp3
      album2 (this is a normal unzipped folder)
          song12.mp3
          song14.mp3
          song16.mp3
  </code></pre>
  
  <p>But for some reason, for <code>album1</code> the files are extracted directly in <code>cache</code> directory instead of <code>cache/album1</code>. </p>
  
  <p><strong>This is what it looks like and I don't want this</strong>:</p>
  
  <pre><code>cache
      song1.mp3
      song2.mp3
      song3.mp3
      album2 (this is a normal unzipped folder)
          song12.mp3
          song14.mp3
          song16.mp3
  </code></pre>
  
  <p><strong>Below is my code:</strong></p>
  
  <pre><code>for zipped_album in os.listdir('music_folder'):
      zip_ref = ZipFile('music_folder/' + zipped_album, 'r')
      zip_ref.extractall('cache')
      zip_ref.close()
  </code></pre>
  
  <p>Any ideas why the files are not extracted in a folder inside <code>chache</code> for <code>album1</code>? It works for <code>album2</code></p>