[cse491] parse_qs

Qingpeng Zhang qingpeng at msu.edu
Thu Sep 25 20:42:34 PDT 2008


I tried parse_qsl function to solve this "order" problem. This
function  returns the parsed data as a list of name, value pairs. It
seems that it works fine. I am just not sure if there is any other
side effect..


best wishes,
Qingpeng Zhang




On Tue, Sep 23, 2008 at 7:35 PM, C. Titus Brown <ctb at msu.edu> wrote:
> On Tue, Sep 23, 2008 at 07:27:18PM -0400, Brett Thomas Mcmillen wrote:
> -> Im using the the cgi function to parse the
> ->
> -> "name=test&name=test2&blah=foo" query string and I get
> ->
> -> {'blah': ['foo'], 'name': ['test', 'test2']}
> ->
> -> My question is how do I know how long the query string is going to be? For
> -> instance a parsed query string could look like this:
> ->
> -> {'yo': ['fool'], 'name': ['test', 'test2', 'test3', 'test4'......etc]}
>
> Hi, Brett,
>
> parse_qs returns a dictionary.  So you can just do a 'len' on it.
>
> The values in the returned dictionary are lists of the form values.
>
> --t
> --
> C. Titus Brown, ctb at msu.edu
>
> _______________________________________________
> cse491-fall-2008 mailing list
> cse491-fall-2008 at lists.idyll.org
> http://lists.idyll.org/listinfo/cse491-fall-2008
>



-- 
Sincerely,
Qingpeng



More information about the cse491-fall-2008 mailing list