📜  获取json数据python代码示例

📅  最后修改于: 2022-03-11 14:45:35.658000             🧑  作者: Mango

代码示例1
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)