Answers for "how to read string value from json file in python"

89

python read json file

import json

with open('path_to_file/person.json') as f:
  data = json.load(f)

print(data)
Posted by: Guest on April-08-2020
3

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

Code answers related to "how to read string value from json file in python"

Python Answers by Framework

Browse Popular Code Answers by Language