Created
September 11, 2014 07:16
-
-
Save mozillazg/f263841d3760253daa8e to your computer and use it in GitHub Desktop.
urldecode like urllib.urlencode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urlparse | |
def urldecode(query_str): | |
""" | |
>>> urldecode('a=1&b=2') | |
{'a': '1', 'b': '2'} | |
""" | |
return dict(urlparse.parse_qsl(query_str)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment