Skip to content

Instantly share code, notes, and snippets.

@tonijz
Created February 15, 2013 14:32
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 tonijz/4960728 to your computer and use it in GitHub Desktop.
Save tonijz/4960728 to your computer and use it in GitHub Desktop.
Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from urlparse import parse_qs
>>> url = "test=1&test2=2&test3=3"
>>> parse_qs(url)
{'test': ['1'], 'test3': ['3'], 'test2': ['2']}
>>> result = parse_qs(url)
>>> result.get('test')
['1']
>>> result.get('test')[0]
'1'
>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment