Skip to content

Instantly share code, notes, and snippets.

@huobazi
Forked from pasberth/to_param.py
Created July 28, 2011 00:24
Show Gist options
  • Save huobazi/1110659 to your computer and use it in GitHub Desktop.
Save huobazi/1110659 to your computer and use it in GitHub Desktop.
Dict To QueryString
#
# dict = { "key0": "value0", "key1": "value1", "key2": "value2" }
"&".join( [("%s=%s" % (k, v)) for k, v in dict.items()] )
# => 'key2=value2&key1=value1&key0=value0'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment