📜  从文件python代码示例中获取json

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

代码示例6
import json

with open('data.txt') as json_file:
    data = json.load(json_file)
    for p in data['people']:
        print('Name: ' + p['name'])
        print('Website: ' + p['website'])
        print('From: ' + p['from'])
        print('')