Skip to content

Instantly share code, notes, and snippets.

@peterbe
Created February 27, 2014 15:56
Show Gist options
  • Save peterbe/9252872 to your computer and use it in GitHub Desktop.
Save peterbe/9252872 to your computer and use it in GitHub Desktop.
>>> for key, values in cgi.parse_qs('date=xxx&date=yyy&name=peter').items():
... if len(values) == 1: values = values[0]
... things[key] = values
...
>>> things
{'date': ['xxx', 'yyy'], 'name': 'peter'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment