Python:JSON: Difference between revisions

From wiki
Jump to navigation Jump to search
Created page with ";import json :Enable json functions ;json.dumps(dict, indent=4) :Return the dict nicely structured. Indent each level with 4 spaces. :Can be used on other datatypes too."
 
mNo edit summary
Line 1: Line 1:
;import json
;import json
:Enable json functions
:Enable json functions. The json module is standard available (no installation needed)


;json.dumps(dict, indent=4)
;json.dumps(dict, indent=4)
:Return the dict nicely structured. Indent each level with 4 spaces.
:Return the dict nicely structured. Indent each level with 4 spaces.
:Can be used on other datatypes too.
:Can be used on other datatypes too.

Revision as of 11:14, 16 March 2018

import json
Enable json functions. The json module is standard available (no installation needed)
json.dumps(dict, indent=4)
Return the dict nicely structured. Indent each level with 4 spaces.
Can be used on other datatypes too.