我正试图根据条件返回填充颜色,但这会将颜色发送到所有标签。请告诉我如何在烧瓶中使用“This.”或“Self”函数
@app.route('/body/<part>')
def show_blog(part):
claim = int(Assembled_ClaimsDF.loc[part])
if claim>10000:
return redirect(url_for('colour_red'))
else:
return redirect(url_for('colour_green'))
@app.route('/colour_red')
def colour_red():
return render_template('new.html', colour = 'red')
@app.route('/colour_green')
def colour_green():
return render_template('new.html', colour = 'yellow')
@app.route('/')
def index():
return render_template('new.html')
if __name__ == '__main__':
app.run()
目前没有回答
相关问题 更多 >
编程相关推荐