代码之家  ›  专栏  ›  技术社区  ›  Abhishek Kulkarni

python dash服务器未更新

  •  0
  • Abhishek Kulkarni  · 技术社区  · 7 年前

    我正在刻意学习短跑的基本知识。以下代码工作正常。

    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',但仍然不起作用

    1 回复  |  直到 6 年前
        1
  •  1
  •   Frayal    7 年前

    从我对你的问题的理解来看,你正在运行两个应用程序,而你无法将另一个应用程序可视化。 要做到这一点,你必须改变你要寻找的港口:

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

    因为这应该是个骗局。不能在同一端口上运行两个Dash应用程序。

    推荐文章
    pilu  ·  Plotly Dash API文档
    7 年前