title: Size of files compressed with python gzip module is not reduced
body: <p>I made a simple test code that generates a lot of integers and writes them into a compressed file using the <a href="https://docs.python.org/3/library/gzip.html" rel="nofollow noreferrer">gzip</a> module.</p>
  
  <pre><code>import gzip
  for idx in range(100000):
      with gzip.open('output.gz', 'ab') as f:
          line = (str(idx) + '\n').encode()
          f.write(line)
  </code></pre>
  
  <p>The compressed file is created but when I decompress it, the raw data are actually a lot smaller:</p>
  
  <pre><code>$ ls -l
    588890 output
   3288710 output.gz
  </code></pre>
  
  <p>Can you please explain what am I doing wrong here?</p>