{ "metadata": { "kernelspec": { "codemirror_mode": { "name": "ipython", "version": 3 }, "display_name": "IPython (Python 3)", "language": "python", "name": "python3" }, "name": "", "signature": "sha256:1bbd16f32ec50ec64d4dd646cd6868aeace8091cac989107f2026fc688ca3701" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "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", "collapsed": false, "input": [ "from __future__ import print_function\n", "from IPython.html.widgets import interact, interactive, fixed\n", "from IPython.html import widgets" ], "language": "python", "metadata": {}, "outputs": [] }, { "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 |