title: How do I gzip compress a string in Python?
body: <p>How do I gzip compress a string in Python?</p>
  
  <p><a href="https://docs.python.org/2/library/gzip.html#gzip.GzipFile" rel="noreferrer"><code>gzip.GzipFile</code></a> exists, but that's for file objects - what about with plain strings?</p>