Answers for "validate json file programmatically in python"

1

validate json file programmatically in python

import json

def parse(filename):
    try:
        with open(filename) as f:
    	return json.load(f)
    except ValueError as e:
        print('invalid json: ' + filename)
        return None # or: raise
Posted by: Guest on December-19-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language