Events jupyterlab按钮事件不工作
此代码在jupyter笔记本中可用,但在jupyterlab中不可用:Events jupyterlab按钮事件不工作,events,jupyter-notebook,jupyter-lab,Events,Jupyter Notebook,Jupyter Lab,此代码在jupyter笔记本中可用,但在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_c
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.12.2
- Python 2.7.14::Anaconda公司
- Jupyter笔记本电脑5.4.0
- Jupyter实验室0.31.5
import ipywidgets as widgets
button = widgets.Button(description='Display Chart')
out = widgets.Output()
def on_button_clicked(b):
button.description = 'clicked'
with out:
print('Ay')
button.on_click(on_button_clicked)
widgets.VBox([button, out])
哼,目前最新版本的Jupyter即使在普通笔记本电脑上也不起作用