Trying to fix basic functionality again.
This commit is contained in:
14
scripts/check_json.py
Normal file
14
scripts/check_json.py
Normal file
@@ -0,0 +1,14 @@
|
||||
import json
|
||||
import sys
|
||||
|
||||
path = sys.argv[1]
|
||||
with open(path, 'r') as f:
|
||||
content = f.read()
|
||||
|
||||
print(f"File has {content.count('{')} opening braces and {content.count('}')} closing braces")
|
||||
|
||||
try:
|
||||
json.loads(content)
|
||||
print('Valid JSON')
|
||||
except Exception as e:
|
||||
print(f'Invalid JSON: {e}')
|
||||
Reference in New Issue
Block a user