In [6]:
from ipywidgets import interact, interactive, fixed
import ipywidgets as widgets
from IPython.display import display

In [11]:
dd1 = widgets.Dropdown(
    options={'One': 1, 'Two': 2, 'Three': 3},
    value=2,
    description='Number:',
)
dd2 = widgets.Dropdown(
    options={'One': 1, 'Two': 2, 'Three': 3},
    value=2,
    description='Number:',
)
display(dd1, dd2)

def on_dd1_change(change):
    dd2.options = {'new': change['new'], 'old': change['old']}
    dd2.value = change['new']
    #print(change['new'])

dd1.observe(on_dd1_change, names='value')

int_range = widgets.IntSlider()
display(int_range)

def on_value_change(change):
    print(change['new'])

int_range.observe(on_value_change, names='value')


1
6
16
45
47
53
54
53
51
49
47
44
35

In [7]:
def f(x):
    return x

In [8]:
interact(f, x=(-100,100,5), continuous_update=False)


Out[8]:
0
Out[8]:
<function __main__.f>

In [9]:
interact(f, x=(-100,100,5), continuous_update=True)


Out[9]:
0
Out[9]:
<function __main__.f>

In [10]:
interact(f, x=(-100,100,5), __manual=True)


Out[10]:
<function __main__.f>

In [ ]:


In [ ]:


In [ ]: