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

# -*- 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}'

 

posted @ 2015-10-31 08:43  Xiao|Deng  阅读(745)  评论(0编辑  收藏  举报