Welcome to Muto S2 Robot repository
5.Widgets controls use
5.Widgets controls use
- Load relevant libraries
from __future__ import print_functionfrom ipywidgets import interact, interactive, fixed, interact_manualimport ipywidgets as widgets
- Configuration function
xxxxxxxxxxdef f(x):return x
- Use UI controls (interact)
xxxxxxxxxxinteract(f, x=10);

xxxxxxxxxxinteract(f, x=widgets.IntSlider(min=-10, max=30, step=1, value=10));

xxxxxxxxxxinteract(f, x=True);

xinteract(f, x='Hi there!');

xxxxxxxxxx@interact(x=True, y=1.0)def g(x, y):return (x, y)

xxxxxxxxxxinteract(f, x=['apples','oranges']);

xxxxxxxxxxinteract(f, x=[('one', 10), ('two', 20)]);
