debug.ipynb

[1]:
import ipywidgets as widgets
slider = widgets.FloatSlider(description='x')
text = widgets.FloatText(disabled=True, description='$x^2$')

def compute(*ignore):
    text.value = str(slider.value**2)

slider.observe(compute, 'value')
slider.value = 14
widgets.VBox([slider, text])
[2]:
import os

def kill_kernel(change):
    os._exit(0)

button = widgets.Button(description="Kill Kernel")
button.on_click(kill_kernel)
button