Answers for "python read json file print key value"

1

python get json content from file

import json

with open('data.json') 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('')
Posted by: Guest on December-21-2020
-1

python read json file array

import json
arr = json.loads("example.json")
# Do nifty stuff with resulting array.
Posted by: Guest on August-22-2021

Python Answers by Framework

Browse Popular Code Answers by Language