【发布时间】:2018-08-09 15:30:59
【问题描述】:
我有一个json文件,如下:
{
"author":"John",
"desc": "If it is important to decode all valid JSON correctly \
and speed isn't as important, you can use the built-in json module, \
orsimplejson. They are basically the same but sometimes simplej \
further along than the version of it that is included with \
distribution."
//"birthday": "nothing" //I comment this line
}
这个文件是由另一个程序自动创建的。如何用 Python 解析它?
【问题讨论】:
-
句柄是什么意思??
-
那不是 JSON,所以你必须扩展一个 JSON 解析器(或者写一个新的;它不是那么复杂的格式......)。
-
另外,这些是斜杠,而不是反斜杠。
-
这意味着我必须在调用标准 json 解析器之前更改其样式?
-
您与“另一个程序”的供应商交谈并要求他们提供 JSON。那不是 JSON,因为 JSON 不支持 cmets。