ValueError: Expecting property name: line 1 column 2 (char 1)

 

 代码:

import json

str2 = '{"domain":"456"}'
str1 = "{'domain':'123'}"
print json.loads(str2)
print json.loads(str1)

 python json.loads() 标准的书写键与值 ,以双引号作为解析标准。单引号则会报错。

相关文章:

  • 2021-07-09
  • 2021-04-01
  • 2022-12-23
  • 2021-04-22
  • 2022-12-23
  • 2021-04-02
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-10
  • 2022-12-23
  • 2021-07-11
  • 2021-08-23
相关资源
相似解决方案