【发布时间】:2019-04-28 17:56:45
【问题描述】:
我敢肯定,我在这里有一个非常基本的问题,但这让我很头疼。我有一个烧瓶/python 程序,基本上,在提交表单后,变量的值会更改并且页面刷新,现在包括显示该变量的文本。
这里有一些示例代码来迭代我的想法:
@app.route("/", methods=["GET", "POST"])
def index():
if request.method == "POST":
if counter == 'one':
#stuff happens here
counter == 'two'
else:
if counter == 'two':
#stuff happens
counter == 'three'
else:
counter == 'one'
return render_template("index.html",counter=counter)
...
有什么帮助吗?我是新手,所以我可能只是在做一些愚蠢的事情。
【问题讨论】: