15 * 15

def f(x, y):
    print(x * y)

from ipywidgets import *
from traitlets import dlink

interact(f, x=(0, 100), y=['a',  'b']);

"""
Explanation: Jupyter Interactive widgets
The notebook comes alive with the interactive widgets:

Part of the Jupyter project
BSD Licensed

Installation for the legacy notebook:
bash
conda install -c conda-forge ipywidgets
Speeding up the bottleneck in the REPL
<img src="images/Flow.svg"></img>
End of explanation
"""


slider = FloatSlider(
    value=7.5,
    min=5.0,
    max=10.0,
    step=0.1,
    description='Input:',
)

slider

slider

slider.value

slider.keys

slider.readout_format = '.4f'

text = FloatText(description='Value')
dlink((slider, 'value'), (text, 'value'))
text

slider

"""
Explanation: Interactive Jupyter widgets
End of explanation
"""


slider

ft = FloatText()

def foo(change):
    ft.value = change.new

slider.observe(foo, names=['value'])

ft

from ipywidgets import HBox

HBox([slider, slider, ft])

"""
Explanation: Widgets are represented in the back-end by a single object.  Each time a widget is displayed, a new representation of that same object is created in the front-end.  These representations are called views.
End of explanation
"""


