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}'
无语言基础,自学python所做的各种笔记,欢迎大牛指点.