我創(chuàng)建了一個(gè)全局的字典.
pythongTest = {}
然后在 Web 的調(diào)用方法中操作這個(gè)字典.
python@app.route('/test', methods=['GET'])
def test():
if "int" in gTest:
ret = gTest["int"] = gTest["int"] + 1
else:
ret = gTest["int"] = 1
return str(ret)
在本地測(cè)試,結(jié)果就是我期望的, 1,2,3,4,5,6...
但是放在 SAE / BAE 上返回值是不固定的, 1, 2, 3, 1, 2
添加回答
舉報(bào)
0/150
提交
取消