{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Using Interact" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The `interact` function (`IPython.html.widgets.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 }, "outputs": [], "source": [ "from __future__ import print_function\n", "from IPython.html.widgets import interact, interactive, fixed\n", "from IPython.html import widgets" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
Keyword argument | Widget |
`True` or `False` | CheckboxWiget |
`'Hi there'` | TextareaWidget |
`value` or `(min,max)` or `(min,max,step)` if integers are passed | IntSliderWidget |
`value` or `(min,max)` or `(min,max,step)` if floats are passed | FloatSliderWidget |
`('orange','apple')` or `{'one':1,'two':2}` | DropdownWidget |