Read and decode json file in Python. You can use the same method for regular json strings.
Source code viewer
# Import json file. import json # Import pprint to pretty print the decoded json. from pprint import pprint # Read the json from file. with open('./my_file.json', 'r') as data_file: # Decode json. json = json.load(data_file) # Pretty print decoded json structure. pprint(json)Programming Language: Python