from bokeh.io import curdoc
from bokeh.models.widgets import Paragraph, Button
from bokeh.layouts import row, widgetbox
from bokeh.models import ColumnDataSource, Slider
from bokeh.plotting import figure
notifications = Paragraph(text='initial text')#, name=name, width=width, height=height)
button = Button(label="Click me to add text")
def callback():
notifications.text += 'more text' + '\n'
button.on_click(callback)
# Set up layout and add to document
box = widgetbox(notifications, button)
curdoc().add_root(row(box))
行中的“\n”
notifications.text += 'more text' + '\n'
不管它在不在那里,什么都不做。我也试过了
notifications.text += 'more text' + '<br />'
如果在这里解释html,但它不起作用。我还能尝试什么?