Help a newbie revise my program

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Mon Apr 26 02:16:06 EDT 2004


In <JR0jc.25858$NR5.10366 at fe1.texas.rr.com>, Paul McGuire wrote:

>>>> import cgi
>>>> print cgi.parse_qs("shaped=5&sized=7")
> {'sized': ['7'], 'shaped': ['5']}
>>>>
>>>>
> I can't explain why the dictionary values are lists, though - I would have
> expected scalar strings.

It's allowed to use the same key in URLs twice or more:

>>> import cgi
>>> print cgi.parse_qs("shaped=5&sized=7&sized=42")
{'sized': ['7', '42'], 'shaped': ['5']}
>>>

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list