How to open JSON file in python?
The Full form of JSON is JavaScript object notation. This type of file is used to store data in python also. It is a popular data format used for representing structured data.
We have an in-built library name as JSON which is imported when we want to open a JSON file in python.
JSON library has in-built function like load() and loads() which help in reading the data from the file.
syntax:-
import json with open('path_to_file/person.json') as f: data = json.load(f) print(data)
In this way we can easily open the JSON file in python
We can read, write, update and delete data from the JSON file using its in-built functions.
Subscribe
Login
Please login to comment
0 Discussion