{ "metadata": { "name": "", "signature": "sha256:6d8c7c51322c4911e478068e8fa8e897bd72c614096f5df110ed86d01d66001c" }, "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 IPython.html.widgets import interact, interactive, fixed\n", "from IPython.html import widgets" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 1 }, { "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 |