我正在尝试使用多选小部件让用户从国家列表中进行选择,然后有一个小部件按钮,当点击时,运行下方的所有单元格。
这将显示列表。
from IPython.display import display
w = widgets.SelectMultiple(
description="Select up to five countries",
options=dfCountries['name'].tolist()
)
display(w)
我希望能够运行下方所有单元格的代码:
def run_all(button):
get_ipython().run_cell()
button = widgets.Button(description="Create next input")
button.on_click(run_all)
display(button)
但是我找不到“运行下面的所有单元格”的钩子。
谢谢。
Javascript('IPython.notebook.execute_cells_below()')
。 - quadrismegistus