@app.route怎么执行

@app.route('/getlast')
def getlast():
    return (las)    

@app.route('/')
def index(): 
    return render_template('index.html', u=u, l = l)

if __name__ == '__main__':
    app.run(host='0.0.0.0', port =8000, debug=True, threaded=True)
    

类似这种 app.run执行的是哪个app.route?
app.rounte括号里的参数要和下面函数名一致吗?

app.route括号里的参数不一定要下面函数名一致
app.route括号里的参数类似于是你前端网页访问地址的key
https://blog.csdn.net/weixin_57871623/article/details/121576995
给你举个例子:
只设置 @app.route('/xx') 的话
你的网页打开127.0.0.1:5000是空的,需要在上面地址那里加上/xx,网址也就成了127.0.0.1:5000/xx

app.rounte括号里的参数只是一个路由的名称,可以随意,不一定非要和方法名称一致

这个是路由和函数 知识混淆了

@app.route('questions') 是路由 即 URL,名字随意 符合 url标准即可 比如: csdn.net/questions , 取这个名字 questions
def index( ) 这个是 python 中的函数. 名字随意,符合python标准即可

整体理解就是.. 当浏览器 访问了这个URL后执行的函数是什么.

所以 名字可以随意取... 取一样是方便后期维护的时候方便