title: Getting all of the request parameters in Python
body: <p>This is a first step for my in <code>Python</code> on a <code>Linux</code> web-server using <code>mod-WSGI</code>.</p>
  
  <p>I'm trying to get all of the <code>cell</code> parameters from the URL in a list like this:</p>
  
  <pre><code>...&amp;cell=&amp;cell=1&amp;cell=2&amp;cell=3&amp;cell=4&amp;cell=5&amp;cell=6&amp;cell=7&amp;cell=8&amp;...
  </code></pre>
  
  <p>So I started with code like this:</p>
  
  <pre><code>def application(environment, start_response):
      import cgi
      form = cgi.FieldStorage(fp = environment['wsgi.input'], environ = environment)
      temp_table_inputs=form.getlist('cell')
  </code></pre>
  
  <p>But I found that the first <code>cell</code> parameter is missing from the list (I presume because <a href="http://docs.python.org/2/library/cgi.html?highlight=getlist#cgi.FieldStorage.getlist" rel="nofollow">getlist</a> removes it as the content is blank).</p>
  
  <p>Two questions:  </p>
  
  <ul>
  <li>How can I get a list including the blank values?</li>
  <li>How can I find which positions in the list are skipped by <code>getlist</code>? </li>
  </ul>
  
  <p><em>Note</em>: I know the <code>cell</code> stuff has a positional dependency but I'd rather look for a way to cope with that before naming the parameters according to their position (I inherited the code and quite a bit depends on the positional stuff, so renaming things will take a lot of effort).</p>