CGI getting multiple values with same name into a list

Manus Hand mjhand at concentric.net
Tue May 9 18:29:34 EDT 2000


Here is how I do what you are wanting to do.

form, data = cgi.FieldStorage(), {}
for key in form.keys():
    if type(form[key]) != type([]): data[key] = form[key].value
    else: data[key] = map(lambda x: x.value, form[key])

Hope that helps,
Manus




More information about the Python-list mailing list