Answers for "how to open json 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
0

how to read json from python

#this code helps translate JSON file
#to a dictionary

import json

person = '{"name": "Bob", "languages": ["English", "Fench"]}'
person_dict = json.loads(person)

print( person_dict)

print(person_dict['languages'])
Posted by: Guest on September-30-2021

Python Answers by Framework

Browse Popular Code Answers by Language