3个具有相同输入列表的回调,其中2个被调用,但不是1。在第三个通知的调试器中,执行直接从输入列表跳出函数。任何暗示欢迎...
@app.callback(
dash.dependencies.Output('firstcallback', 'children'),
[dash.dependencies.Input('firstdropdown', 'value'),
dash.dependencies.Input('seconddropdown', 'value')])
def firstgoodcallback(first, second):
print("firstgoodcallback") #prints ok
return u'{} is a reference to {}'.format(first, second)
@app.callback(
dash.dependencies.Output('secondcallback', 'children'),
[dash.dependencies.Input('firstdropdown', 'value'),
dash.dependencies.Input('seconddropdown', 'value')])
def secondgoodcallback(first, second):
print("secondgoodcallback") #prints ok
return u'{} is a second reference to {}'.format(first, second)
@app.callback(
dash.dependencies.Output('thirdcallback', 'children'),
[dash.dependencies.Input('firstdropdown', 'value'),
dash.dependencies.Input('seconddropdown', 'value')])
def set_display_children(first, second):
print("helloWorld") #doesn't get this far
return u'{} is a third reference to {}'.format(first, second)
'firstdropdown'
和'seconddropdown'
都在启动时用默认值初始化,并且所有回调都在具有name==main
保护的同一模块中。谢谢