Jump to content

Python: Difference between revisions

158 bytes added ,  26 February 2020
Line 279: Line 279:
# Decode/Parse
# Decode/Parse
json.loads("{}")
json.loads("{}")
# Write to file
with open("my_data.json", "w") as f:
  json.dump(my_data, f)
# Read from file
with open("my_data.json", "r") as f:
  my_data = json.load(f)
</syntaxhighlight>
</syntaxhighlight>