We can use multiple ipywidgets and use observe
to make some calculation.
With illusionist
we make this static so it runs without a kernel.
import ipywidgets as widgets
slider = widgets.IntSlider(description="Number", max=10, value=5)
slider
bounded_int = widgets.BoundedIntText(description="Multiplier", value=2, min=0, max=5)
bounded_int
multiplication = widgets.Label()
multiplication
def update_lbl(args):
multiplication.value = str(slider.value * bounded_int.value)
update_lbl(None)
slider.observe(update_lbl, 'value')
bounded_int.observe(update_lbl, 'value')