From charlesreid1

Revision as of 08:44, 21 February 2018 by Admin (talk | contribs) (Created page with "to print out pretty json using Python: <pre> d = dict(a=1,b=2,c=3) with open('pretty.json','w') as f: json.dump(d, f, separators=(',',': '),indent=4) </pre>")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

to print out pretty json using Python:

d = dict(a=1,b=2,c=3)
with open('pretty.json','w') as f:
    json.dump(d, f, separators=(',',': '),indent=4)