title: Decompress remote .gz file in Python
body: <p>i've a issue with Python.</p>
  
  <p>My case: i've a gzipped file from a partner platform (i.e. h..p//....namesite.../xxx)
  If i click the link from my browser, it will download a file like (i.e. namefile.xml.gz).</p>
  
  <p>So... if i read this file with python i can decompress and read it.</p>
  
  <p>Code:</p>
  
  <pre><code>content = gzip.open(namefile.xml.gz,'rb')
  print content.read()
  </code></pre>
  
  <p>But i can't if i try to read the file from remote source.
  From remote file i can read only the encoded string, but not decoded it.</p>
  
  <p>Code:</p>
  
  <pre><code>response = urllib2.urlopen(url)
  encoded =response.read()
  print encoded
  </code></pre>
  
  <p>With this code i can read the string encoded... but i can't decoded it with gzip or lzip.</p>
  
  <p>Any advices?
  Thanks a lot</p>