CGI getting multiple values with same name into a list

Manus Hand mjhand at concentric.net
Wed May 10 00:29:34 CEST 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