This is a first step for my in Python on a Linux web-server using mod-WSGI.
I'm trying to get all of the cell parameters from the URL in a list like this:
...&cell=&cell=1&cell=2&cell=3&cell=4&cell=5&cell=6&cell=7&cell=8&...
So I started with code like this:
def application(environment, start_response):
import cgi
form = cgi.FieldStorage(fp = environment['wsgi.input'], environ = environment)
temp_table_inputs=form.getlist('cell')
But I found that the first cell parameter is missing from the list (I presume because getlist removes it as the content is blank).
Two questions:
- How can I get a list including the blank values?
- How can I find which positions in the list are skipped by
getlist?
Note: I know the cell 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).