Created
February 15, 2013 14:32
-
-
Save tonijz/4960728 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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