小编col*_*ter的帖子

IPython - 从小部件运行下面的所有单元格

我正在尝试使用多选小部件来使用户能够从国家/地区列表中进行选择,然后有一个小部件按钮,当单击该按钮时,它会运行下面的所有单元格.

这会显示列表.

from IPython.display import display
w = widgets.SelectMultiple(

    description="Select up to five countries",
    options=dfCountries['name'].tolist()   
)
display(w)
Run Code Online (Sandbox Code Playgroud)

我想要这样的东西运行下面的所有单元格:

def run_all(button):
    get_ipython().run_cell()

button = widgets.Button(description="Create next input")
button.on_click(run_all)
display(button)
Run Code Online (Sandbox Code Playgroud)

但我找不到"运行下面所有细胞的钩子"

谢谢

cell ipython jupyter

12
推荐指数
2
解决办法
7138
查看次数

标签 统计

cell ×1

ipython ×1

jupyter ×1