Answers for "how to write to a.json file in python"

12

open json file python

import json

with open('data.txt') as json_file:
    data = json.load(json_file)
Posted by: Guest on March-02-2020
5

write json pythonb

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('')
Posted by: Guest on November-29-2019

Code answers related to "how to write to a.json file in python"

Python Answers by Framework

Browse Popular Code Answers by Language