Python: Difference between revisions
(→JSON) |
|||
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 |