O'Reilly logo

Learning Jupyter by Dan Toomey

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Widget basics

All widgets work the same, generally:

  • You create or define an instance of a widget.
  • You can preset attributes of a widget, such as its initial value or a label to be displayed.
  • Widgets can react to different inputs from a user. The inputs are gathered by a handler or a Python function that is invoked when a user performs some action on a widget; for example, a function could be set up to call the handler if the user clicks on a button.
  • The value of a widget can be used later in your script in the same way as any other variable; for example, you could use a widget to determine how many circles to draw.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required