【发布时间】:2018-04-25 18:31:26
【问题描述】:
此代码在 jupyter notebook 中有效,但在 jupyterlab 中无效:
import ipywidgets as widgets
from IPython.display import display
button = widgets.Button(description="Click Me!")
display(button)
def on_button_clicked(b):
print("Button clicked.")
button.on_click(on_button_clicked)
有人有解决办法吗?
环境:
- MacOsX 10 10.12.2
- Python 2.7.14 :: Anaconda, Inc.
- Jupyter Notebook 5.4.0
- Jupyter 实验室 0.31.5
【问题讨论】:
标签: events jupyter-notebook jupyter-lab