这里是我的JSON文件格式,在python中逐行加载json时出错?
[{
"name": "",
"official_name_en": "Channel Islands",
"official_name_fr": "Îles Anglo-Normandes",
}, and so on......
同时加载上面JSON是在一个文件中我得到这个错误,
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes:
这里是我的Python代码,
import json
data = []
with open('file') as f:
for line in f:
data.append(json.loads(line))
也许列表中的某个属性实际上是单引号而不是双引号? – elena