Skip to content

Instantly share code, notes, and snippets.

@pasberth
Created July 27, 2011 23:07
Show Gist options
  • Save pasberth/1110561 to your computer and use it in GitHub Desktop.
Save pasberth/1110561 to your computer and use it in GitHub Desktop.
ディクショナリをgetのパラメタにする
#
# 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