我已阅读过删除列表中的字符“ u”的信息,但我使用的是Google App Engine,它似乎不起作用!
def get(self):
players = db.GqlQuery("SELECT * FROM Player")
print players
playerInfo = {}
test = []
for player in players:
email = player.email
gem = str(player.gem)
a = "{email:"+email + ",gem:" +gem +"}"
test.append(a)
ast.literal_eval(json.dumps(test))
print test
最终输出:
[u'{email:test@gmail.com,gem:0}', u'{email:test,gem:0}', u'{email:test,gem:0}', u'{email:test,gem:0}', u'{email:test,gem:0}', u'{email:test1,gem:0}']
慕森王
POPMUISE
相关分类