Skip to content

Instantly share code, notes, and snippets.

@mozillazg
Created September 11, 2014 07:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mozillazg/f263841d3760253daa8e to your computer and use it in GitHub Desktop.
Save mozillazg/f263841d3760253daa8e to your computer and use it in GitHub Desktop.
urldecode like urllib.urlencode
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