Read JSON File
Reads a JSON file and parses its content.
- json
- file
- read
Code
import json
def read_json(filepath):
with open(filepath, 'r') as file:
return json.load(file)Usage
read_json('data.json') # Returns: Content of file as dictReads a JSON file and parses its content.
import json
def read_json(filepath):
with open(filepath, 'r') as file:
return json.load(file)read_json('data.json') # Returns: Content of file as dict