Best way to update/rerun cell after widget change - compatible with Voila

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')

Cell 1:


I would like to rerun cell 1 when the slider value changes. I’ve looked so for into:

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 :slight_smile: