How to read json file in python?
There are several ways are there to read data from json file. JSON which stands for javascript object notation is one of the commonly used file in application development because of its advantages. Python has so many libraries to read data from files. Here we see python program to read data from json without using pandas.
import json
try:
with open("emp.json",'r') as jsonfile:
reader=json.load(jsonfile)
for i in reader.items():
print(i)
jsonfile.close()
except FileNotFoundError:
print("no file exist")
No comments:
Post a Comment