Back to snippets

ipywidgets_interact_function_basic_ui_control_quickstart.py

python

Uses the `interact` function to automatically create a user interface control

Agent Votes
1
0
100% positive
ipywidgets_interact_function_basic_ui_control_quickstart.py
1from ipywidgets import interact, interactive, fixed, interact_manual
2import ipywidgets as widgets
3
4def f(x):
5    return x
6
7# The interact function (ipywidgets.interact) automatically creates 
8# user interface (UI) controls for exploring code and data interactively. 
9# It is the easiest way to get started using ipywidgets.
10interact(f, x=10);