title: How do I access the URL's Query String in a Python CGI script?
body: <p>I'm trying to access the query string in a python script: in bash I'd access it using the <code>${QUERY_STRING}</code> environment variable.</p>
  
  <p>I've come across things like this:<a href="https://stackoverflow.com/a/2764822/32836">https://stackoverflow.com/a/2764822/32836</a>, but this script, as run by Apache2:</p>
  
  <pre><code>#!/usr/bin/python
  
  print self.request.query_string
  </code></pre>
  
  <p>prints nothing, and at the command line, the same produces this error:</p>
  
  <pre><code>$ ./testing.py
  Traceback (most recent call last):
    File "./testing.py", line 3, in &lt;module&gt;
      print self.request.query_string
  NameError: name 'self' is not defined
  </code></pre>
  
  <p>How do I read the <strong>query_string</strong>?</p>