I'm trying to open a file to view the data in test.json file. File contains string data.
Here is my code:
import json
from pprint import pprint
with open("D:\python\abc.json") as json_file:
json_data = json.load(json_file)
pprint(json_data)
Here is the error generating, I'm confused as I'm newbie in Python. Help Required.
Traceback (most recent call last):
File "C:\Users\joh\workspace\newdic\dic.py", line 20, in <module>
json_data = json.load(json_file)
File "C:\Python33\lib\json\__init__.py", line 271, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File "C:\Python33\lib\json\__init__.py", line 316, in loads
return _default_decoder.decode(s)
File "C:\Python33\lib\json\decoder.py", line 351, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Python33\lib\json\decoder.py", line 367, in raw_decode
obj, end = self.scan_once(s, idx)
ValueError: Expecting ',' delimiter: line 21 column 9 (char 387)