I have the following code:
from bokeh.plotting import curdoc
from bokeh.layouts import widgetbox
from bokeh.layouts import column as bokehCol
from bokeh.models.layouts import Column
from bokeh.models.widgets import DatePicker
from datetime import date
from datetime import timedelta as td
from datetime import datetime as dt
from bokeh.io import output_notebook
from bokeh.plotting import show
output_notebook()
crnt_date=dt.now()
dt_pckr_strt=DatePicker(title='Select start of sync date',min_date=date(2017,1,1),max_date=date.today())
def callback(attr,old,new):
print(type(old))
print('old was {} and new is {}'.format(old,new))
dt_pckr_strt.on_change('value',callback)
curdoc().add_root(bokehCol(dt_pckr_strt))
show(widgetbox(dt_pckr_strt, width=300))
输出显示的是奇怪的日期选择器,而不是常规的日期选择器。我认为问题出在show函数上,我可能犯了一些错误。请问我错在哪里?
Application未定义
。 - harvpan