# -*- coding: cp936 -*-
#xiaodeng
#python 2.7.10 import weibo s='{"name":"xiaodeng","age":28}'
print weibo._parse_json(s) #{'age': 28, 'name': u'xiaodeng'} #ValueError: Expecting property name: line 1 column 1 (char 1) #该错误提示的原因?
#JSON字符串中,不能包含单引号,而必须是双引号 #解决办法:将单引号替换为双引号,如:s='{"name":"xiaodeng","age":28}'
相关文章
- 08-22【已解决】Python中json.loads出错:ValueError: Expecting , delimiter: line 1 column 86 (char 86) – 在路上
- 08-22ValueError: Expecting property name: line 1 column 1 (char 1)
- 08-22JSONDecodeError: Expecting value: line 1 column 1 (char 0)
- 08-22Django 之swagger中尝试调试post请求时返回 "detail": "JSON parse error - Expecting value: line 1 column 1 (char)