Skip to content

Instantly share code, notes, and snippets.

@oinume
Created December 3, 2011 06:48
Show Gist options
  • Save oinume/1426331 to your computer and use it in GitHub Desktop.
Save oinume/1426331 to your computer and use it in GitHub Desktop.
**つけるとdictオブジェクトをキーワード引数に変換できる
def f(**kwargs):
for k, v in kwargs.iteritems():
print "%s => %s" % (k, v)
f(**{ 'key1': 'value1', 'key2': 'value2' })
# output:
# key2 => value2
# key1 => value1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment