{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Using Interact" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The `interact` function (`ipywidgets.interact`) automatically creates user interface (UI) controls for exploring code and data interactively. It is the easiest way to get started using IPython's widgets." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false, "scrolled": true }, "outputs": [], "source": [ "from __future__ import print_function # for python 2\n", "from ipywidgets import interact, interactive, fixed\n", "import ipywidgets as widgets" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
Keyword argument | Widget |
`True` or `False` | Checkbox |
string `'Hi there'` | Textarea |
numeric `value` or `(min,max)` or `(min,max,step)` | IntSlider or FloatSlider |
`('orange','apple')` or `{'one':1,'two':2}` | Dropdown |