簡體   English   中英

Python dash 服務器未更新

[英]Python dash server not updating

我正在通過 plotly 學習 dash 的基礎知識。 以下代碼運行良好。

import dash
from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_html_components as html

app = dash.Dash()

app.layout = html.Div([
    dcc.Input(id='input', value='Enter something here!', type='text'),
    html.Div(id='output')
])

@app.callback(
    Output(component_id='output', component_property='children'),
    [Input(component_id='input', component_property='value')]
)
def update_value(input_data):
    return 'Input: "{}"'.format(input_data)


if __name__ == '__main__':
    app.run_server(debug=True) 

但是當我運行另一個例子時,我得到了上面代碼的輸出。

請提出前進的道路。 感謝您的寶貴時間。

我嘗試從命令提示符運行代碼,但仍然無法正常工作。 我改了 debug='False' 但還是不行

根據我對您的問題的理解,您正在運行兩個應用程序,而您無法將另一個應用程序可視化。 這樣做你必須改變你正在尋找的端口:

app.run_server(debug=True,port=3004)

這應該可以解決問題。 您不能在同一個端口上運行兩個 dash 應用程序。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM