Jump to content

Python: Difference between revisions

10 bytes added ,  2 July 2021
Line 514: Line 514:
# Write to file
# Write to file
with open("my_data.json", "w") as f:
with open("my_data.json", "w") as f:
   json.dump(my_data, f)
   json.dump(my_data, f, indent=2)


# Read from file
# Read from file