我已经在这里读过很多例子了。不幸的是,我不断收到此错误,
Error:
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 1 column 43 (char 42)
json 文件:
{"people": [{"name": "Scott", "from": "Nebraska", "website": "stackabuse.com"}, {"name": "Larry", "from": "Michigan", "website": "google.com"}, {"name": "Tim", "from": "Alabama", "website": "apple.com"}]}
另一个单独的 json 文件:
{"scores":[{"name":"Larry","result":["0":"24","1":"43","2":"56"]},{"name":"Tim","result":["0":"44","1":"29","2":"34"]}]}
蟒蛇代码:
with open('data.json') as file:
data = json.load(file)
print(data)