Answers for "how to use json data in python"

2

Json in python

import json

json_file = json.load(open("your file.json", "r", encoding="utf-8"))

# For see if you don't have error:
print(json_file)
Posted by: Guest on October-16-2020
0

get json data python

import json

# Load json data
with open("example.json", "r") as file:
  json.load(file)
  
# Save dict to json
with open("example2.json", "w") as file:
  data = {"numbers": [1,2,3]}
  json.dump(data, file, indent=2)
Posted by: Guest on July-25-2021

Code answers related to "how to use json data in python"

Code answers related to "Javascript"

Browse Popular Code Answers by Language