小编hag*_*wal的帖子

Dash Python 应用程序按钮用于操作和刷新页面

Dash App 中需要有一个回调函数来执行某些操作然后刷新页面,只能使用 HTML A 标签实现页面重新加载。

html.A(html.Button('Refresh Data'),href='/')
Run Code Online (Sandbox Code Playgroud)

必需的:

app.layout = html.Div([html.Button(id="refresh")])

@app.callback(Output('???', '???'),
          [Input('refresh', 'n_clicks')])
def refresh(n):
## Perform some action ##
## call python function API ##
## Finally Refresh the Page ##
 ?
return ?
Run Code Online (Sandbox Code Playgroud)

python python-3.x plotly-dash

5
推荐指数
2
解决办法
5620
查看次数

标签 统计

plotly-dash ×1

python ×1

python-3.x ×1