get data from json python

没有找到与「get data from json python」相关的内容

AI 回答 由 glm-4-flash 生成 · 仅供参考,请自行核实
1. 导入json库

import json

2. 读取JSON数据

with open('data.json', 'r') as file:
data = json.load(file)

3. 访问数据

name = data['name']
age = data['age']

4. 输出结果

print(f"Name: {name}, Age: {age}")
没有找到「get data from json python」相关的内容

建议:检查关键词是否有错别字,或换一个更常见的说法。