With a simple example:
Cell 0:
import ipywidgets as widgets
slider = widgets.IntSlider()
def value_changed(change):
update_cell(1) # <-- how to do this
slider.observe(value_changed, 'value')
slider
Cell 1:
slider.value
I would like to rerun cell 1
when the slider value changes. I’ve looked so for into:
- execute_cells which works with jupyter notbooks, but not lab
- #6563 Programatically execute cells which someone solved by writing their own plugin
Interestingly both solutions are client side which makes me wonder if that is the best way of approaching this issue. The callback is running inside the python kernel and should execute another piece of python code, so I am unsure if this is even the right angle to go at this.
Any pointers are welcome