我尝试从“自动化钻孔材料”的第14章输入命令,但收到错误消息。
>>> import json
>>> stringOfJsonData = '{"name": "Zophie", "isCat": true, "miceCaught": 0, "felineIQ": None}'
>>> jsonDataAsPythonValue = json.loads(stringOfJsonData)
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
jsonDataAsPythonValue = json.loads(stringOfJsonData)
File "C:\Python36\lib\json\__init__.py", line 354, in loads
return _default_decoder.decode(s)
File "C:\Python36\lib\json\decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Python36\lib\json\decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 64 (char 63)
答案 0 :(得分:2)
.sub-menu
不是有效的JSON值;在JSON中,等效值为None
。