python-scripts/scripts/Check_json_format/script.py
2022-10-03 23:27:52 +05:30

14 lines
304 B
Python

import os
import sys
import json
if len(sys.argv) > 1:
if os.path.exists(sys.argv[1]):
file = open(sys.argv[1], "r")
json.load(file)
file.close()
print("Validate JSON!")
else:
print(sys.argv[1] + " not found")
else:
print("Usage: checkjson.py <file>")