from __future__ import print_function from IPython.html.widgets import interact, interactive, fixed from IPython.html import widgets def f(x): print(x) interact(f, x=10); interact(f, x=True); interact(f, x='Hi there!'); @interact(x=True, y=1.0) def g(x, y): print(x, y) def h(p, q): print(p, q) interact(h, p=5, q=fixed(20)); interact(f, x=widgets.IntSliderWidget(min=-10,max=30,step=1,value=10)); interact(f, x=(0,4)); interact(f, x=(0,8,2)); interact(f, x=(0.0,10.0)); interact(f, x=(0.0,10.0,0.01)); @interact(x=(0.0,20.0,0.5)) def h(x=5.5): print(x) interact(f, x=('apples','oranges')); interact(f, x={'one': 10, 'two': 20}); def f(x:True): print(x) interact(f); from IPython.utils.py3compat import annotate @annotate(x=True) def f(x): print(x) interact(f); def f(a, b): return a+b w = interactive(f, a=10, b=20) type(w) w.children from IPython.display import display display(w) w.kwargs w.result