Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #validate #json #file #programmatically #python
ADD COMMENT
Topic
Name
4+5 =