python中flask路由怎么互相调用
展开全部
用个全局变量
results = None
@app.route('/search', methods=['get', 'post']) #这是搜索页面def fsearch():
.... if request.method == 'POST':
global results
results = multiselect(request) #这是处理表单的函数,reslults为list类型变量
... return render_template("new.html")
@app.route('/result', methods=['get', 'post']) #这是结果页面def fresult():
global results
print results return render_template("result.html")
results = None
@app.route('/search', methods=['get', 'post']) #这是搜索页面def fsearch():
.... if request.method == 'POST':
global results
results = multiselect(request) #这是处理表单的函数,reslults为list类型变量
... return render_template("new.html")
@app.route('/result', methods=['get', 'post']) #这是结果页面def fresult():
global results
print results return render_template("result.html")
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询