我启动了一个脚本,该脚本使用 python 从 JSON 对象中检索一个值,但出现了这些错误
File "c:\Python33\lib\json\__init__.py", line 319, in loads
return _default_decoder.decode(s)
File "c:\Python33\lib\json\decoder.py", line 352, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "c:\Python33\lib\json\decoder.py", line 368, in raw_decode
obj, end = self.scan_once(s, idx)
我的代码如下:
#!/usr/bin/env python
import json
data=json.loads('{WARRANTY:"",ROOT_CATEGORYNAME:"Automobiles",}')
print data['ROOT_CATEGORYNAME']