title: Unzip nested zip files in python
body: <p>I am looking for a way to unzip nested zip files in python. For example, consider the following structure (hypothetical names for ease):</p>
  
  <ul>
  <li>Folder
  
  <ul>
  <li>ZipfileA.zip
  
  <ul>
  <li>ZipfileA1.zip</li>
  <li>ZipfileA2.zip</li>
  </ul></li>
  <li>ZipfileB.zip
  
  <ul>
  <li>ZipfileB1.zip</li>
  <li>ZipfileB2.zip</li>
  </ul></li>
  </ul></li>
  </ul>
  
  <p>...etc. I am trying to access text files that are within the second zip. I certainly  don't want to extract everything, as the shear numbers would crash the computer (there is several hundred zips in the first layer, and almost 10,000 in the second layer (per zip)). </p>
  
  <p>I have been playing around with the 'zipfile' module - I am able open the 1st level of zipfiles. E.g.:</p>
  
  <pre><code>zipfile_obj = zipfile.ZipFile("/Folder/ZipfileA.zip")
  next_layer_zip = zipfile_obj.open("ZipfileA1.zip")
  </code></pre>
  
  <p>However, this returns a "ZipExtFile" instance (not a file or zipfile instance) - and I can't then go on and open this particular data type. That I can't do this:</p>
  
  <pre><code>data = next_layer_zip.open(data.txt)
  </code></pre>
  
  <p>I can however "read" this zip file file with:</p>
  
  <pre><code>next_layer_zip.read()
  </code></pre>
  
  <p>But this is entirely useless! (i.e. can only read compressed data/goobledigook). </p>
  
  <p>Does anyone have any ideas on how I might go about this (<strong><em>without</em></strong> using ZipFile.extract)?? </p>
  
  <p>I came across this, <a href="http://pypi.python.org/pypi/zip_open/" rel="noreferrer">http://pypi.python.org/pypi/zip_open/</a> - which looks to do exactly what I want, but it doesn't seem to work for me. (keep getting "[Errno 2] No such file or directory:" for the files I am trying to process, using that module).</p>
  
  <p>Any ideas would be much appreciated!! Thanks in advance</p>