title: Extracting inner file from zip file with python
body: <p>I am able to extract the inner file, but it extracts the entire chain.<br>
  Suppose the following file structure</p>
  
  <pre><code>v a.zip
      v folder1
          v folder2
              &gt; inner.txt
  </code></pre>
  
  <p>and suppose I want to extract <code>inner.txt</code> to some folder <code>target</code>.<br>
  Currently what happens when I try to do this is that I end up extracting <code>folder1/folder2/inner.txt</code> to <code>target</code>. Is it possible to extract the single file instead of the entire chain of directories? So that when <code>target</code> is opened, the only thing inside is <code>inner.txt</code>.</p>
  
  <p>EDIT:<br>
  Using python zip module to unzip files and extract only the inner files to the desired location.</p>