Skip to content

Instantly share code, notes, and snippets.

@AdamG
Created August 12, 2013 14:19
Show Gist options
  • Save AdamG/6211210 to your computer and use it in GitHub Desktop.
Save AdamG/6211210 to your computer and use it in GitHub Desktop.
% python2
Python 2.7.4 (default, Apr 19 2013, 18:28:01)
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cgi
>>> data = 'next=/contact/200/106260296&next=/contact/200/106260296&next=/contact/200/106260296&next=/contact/200/106260296&'
>>> x = cgi.parse_qs(data)
>>> next_list = x['next']
>>> print next_list
['/contact/200/106260296', '/contact/200/106260296', '/contact/200/106260296', '/contact/200/106260296']
>>> for param in next_list: print param
...
/contact/200/106260296
/contact/200/106260296
/contact/200/106260296
/contact/200/106260296
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment