Jump to content

Python: Difference between revisions

92 bytes added ,  26 February 2020
Line 290: Line 290:
import json
import json


# Encode/Stringify
# Encode/Stringify (pretty)
json.dumps({})
json.dumps({})


Line 304: Line 304:
   my_data = json.load(f)
   my_data = json.load(f)
</syntaxhighlight>
</syntaxhighlight>
; Notes
* Using <code>json.dump(data, f)</code> will dump without pretty printing


==Libraries==
==Libraries==