vkris
vkris

Reputation: 2165

parse_str for python?

Is there a parse_str (used in php) alternative for python?

http://php.net/manual/en/function.parse-str.php
parse_str — Parses the string into variables

Upvotes: 1

Views: 2173

Answers (2)

John La Rooy
John La Rooy

Reputation: 304195

If you are using Python<2.6

parse_qs is in the cgi module

It's still there in 2.7 for backward compatibility

Upvotes: 1

Adam Vandenberg
Adam Vandenberg

Reputation: 20651

urlparse.parse_qs: http://docs.python.org/library/urlparse.html#urlparse.parse_qs

If you are using a Python older than 2.6, the previous location of this function was in the cgi module: http://docs.python.org/library/cgi.html#cgi.parse_qs

Upvotes: 2

Related Questions