title: How to read text files in a zipped folder in Python
body: <p>I have a compressed data file (all in a folder, then zipped). I want to read each file without unzipping. I tried several methods but nothing works for entering the folder in the zip file. How should I achieve that?</p>
  
  <p>Without folder in the zip file:</p>
  
  <pre><code>with zipfile.ZipFile('data.zip') as z:
    for filename in z.namelist():
       data = filename.readlines()
  </code></pre>
  
  <p>With one folder:</p>
  
  <pre><code>with zipfile.ZipFile('data.zip') as z:
        for filename in z.namelist():
           if filename.endswith('/'):
               # Here is what I was stucked
  </code></pre>