WMS_MAIN/temp_parse_json.py
2026-04-17 19:21:57 +08:00

14 lines
399 B
Python

import json
s=open('methods/system.json','r',encoding='utf8').read()
try:
json.loads(s)
print('py OK')
except json.decoder.JSONDecodeError as e:
print('JSONDecodeError:', e.msg, 'lineno', e.lineno, 'colno', e.colno, 'pos', e.pos)
start=max(0,e.pos-120)
print('---context---')
print(s[start:e.pos+120])
print('---end---')
except Exception as e:
print('other error',e)