Feb-25-2020, 10:42 AM
Hi, I am new to the python language (well new to any programming language). From what I have been reding on-line, python has components to validate JSON files, which is what I need to do. In stalled Python 3.81 and found a script on-line that says it will validate a JSON file, however, It is not working for me as I think I am not using it correctly
Here is the code in the script
File "C:\python-script\JSON_Validate.py", line 5
with open("C:\python-script\file\assetLink_tr-TR.json") as f:
^
IndentationError: expected an indented block
I appreciate any help
Bella
Here is the code in the script
import json def parse(text): try: with open("C:\python-script\file\assetLink_tr-TR.json") as f: return json.load(f) except ValueError as e: print('invalid json: %s' % e) return None # or: raiseHere is the error i get when i run the script on the CMD
File "C:\python-script\JSON_Validate.py", line 5
with open("C:\python-script\file\assetLink_tr-TR.json") as f:
^
IndentationError: expected an indented block
I appreciate any help
Bella