学习JSON,我想应该是遵循了语法技巧。我想开始将数据集加载到JSON中并使用Python操作它们。在写数据集时,我开始输入数据,但一直出现这个错误。你知道吗
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 7 column 2 (char 129)
虽然我遵循了多个教程,我不能理解我的错误是从哪里来的?你知道吗
[
{
"name": "x",
"email": "x@x",
"location": "Yorkville Village",
"contacted": "Yes",
},
{
"name": "y",
"email": "y@y",
"location": "Yorkville Village",
"contacted": "Yes",
},
{
"name": "z",
"email": "info@z.com",
"location": "Yorkville Village",
"contacted": "Yes",
},
]
它需要“用双引号括起来的属性名”,如“需要用双引号括起来的[另一个]属性名;它需要另一个属性。这是因为在
k:v
对的末尾有额外的逗号。你知道吗你想要:
问题中显示的Json无效,因为每个对象中都有最后一个逗号。你知道吗
以下是有效版本:
始终使用JSON validator检查JSON是否有效
相关问题 更多 >
编程相关推荐