January 2018
Beginner to intermediate
548 pages
12h 11m
English
The ipywidgets packages provides many built-in control widgets to interact with code and data in the Jupyter Notebook. In this recipe, we show how to build a custom interactive widget from scratch, using Python on the kernel side, and HTML/JavaScript on the client side (frontend). The widget just displays two buttons to increase and decrease a number. The number can be accessed and updated either from the kernel (Python code) or the client (browser).
>>> import ipywidgets as widgets
from traitlets import Unicode, Int, validateCounterWidget class deriving from DOMWidget:>>> class CounterWidget(widgets.DOMWidget): _view_name ...
Read now
Unlock full access