TRIGGERBLOCK
Friday, November 24, 2017
Python : Pretty print JSON
Pretty print JSON
import json
json_data = '["foo", {"bar":["baz", null, 1.0, 2]}]'
parse = json.loads(json_data )
print json.dumps(parse , indent=4, sort_keys=True)
Result :
[
"foo",
{
"bar": [
"baz",
null,
1.0,
2
]
}
]
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment