Py学习  »  Python

python dash服务器未更新

Abhishek Kulkarni • 6 年前 • 1687 次点击  

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

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

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/38890
文章 [ 1 ]  |  最新文章 6 年前
Alexis
Reply   •   1 楼
Alexis    7 年前

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

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

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