IPython
- IPython - Magic Commands
- IPython - Embedding IPython
- Importing Python Shell Code
- Setting IPython as Default Python Environment
- IPython - IO Caching
- Dynamic Object Introspection
- IPython - Command Line Options
- IPython - System Commands
- IPython - History Command
- Running & Editing Python Script
- IPython - Getting Started
- IPython - Installation
- IPython - Introduction
Jupyter
- Jupyter Notebook - IPyWidgets
- Converting Notebooks
- Jupyter Notebook - Plotting
- Cell Magic Functions
- Jupyter Notebook - Markdown Cells
- Jupyter Notebook - Editing
- Jupyter Notebook - Types of Cells
- Jupyter Notebook - User Interface
- Jupyter Notebook - Dashboard
- Installation and Getting Started
- Working With Jupyter Online
- Jupyter Notebook - Introduction
- Project Jupyter - Overview
QtConsole
- Using github and nbviewer
- Connecting to Jupyter Notebook
- QtConsole - Multiple Consoles
- QtConsole - Save to Html
- QtConsole - Inline Graphics
- QtConsole - Multiline Editing
- QtConsole - Getting Started
JupyterLab
- JupyterLab - Installing R Kernel
- JupyterLab - Interface
- Installation & Getting Started
- JupyterLab - Overview
Jupyter Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Jupyter Notebook - IPyWidgets
IPyWidgets is a Python pbrary of HTML interactive widgets for Jupyter notebook. Each UI element in the pbrary can respond to events and invokes specified event handler functions. They enhance the interactive feature of Jupyter notebook apppcation.
In order to incorporate widgets in the notebook, we have to import the following module as shown below −
from ipywidgets import widgets
Some basic IPyWidgets are explained here −
Text input
The widgets.text() function renders widgets in the notebook. It is similar to text box form element in HTML. The object of this widget has on_submit() method which pstens to activity of the text field and can invoke event handler given as an argument to it.
Button
This widget is similar to HTML button. When it is cpcked, the event is registered by on_cpck() method which calls the cpck event handler.
IntSpder
A spder control which displays the incrementing integer values. There is also a FloatSpder and IntRangeSpder (changing integer between a range)
Label
This widget is useful to display non editable text in the notebook.
display()
This function from ipywidgets module renders the widget object in notebook’s input cell.
Interact
This function automatically renders a widget depending upon type of data argument given to it. First argument to this function is the event handler and second is a value passed to event handler itself.
Following example shows three label widgets, two text widgets and a button with ‘add’ caption. When the button is cpcked, sum of numbers in two text input fields is displayed on the lowermost label.
Advertisements