Skip to content

Instantly share code, notes, and snippets.

@yuuichi-fujioka
Created May 21, 2013 02:45
Show Gist options
  • Save yuuichi-fujioka/5617195 to your computer and use it in GitHub Desktop.
Save yuuichi-fujioka/5617195 to your computer and use it in GitHub Desktop.
print out nice json
import json
m ={ 'foo':{'alice': ['first', 'second'], 'backet':'bread'}, 'bar':'hello'}
print json.dumps(m, sort_keys=True, indent=2)
""" output
{
"bar": "hello",
"foo": {
"alice": [
"first",
"second"
],
"backet": "bread"
}
}
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment