Chapter 7. User Interaction

Libraries in this chapter help developers write code that interacts with end users. We describe the Jupyter project—it’s unique—then cover the more typical command-line and graphical user interfaces (GUIs), and finish with a discussion of tools for web applications.

Jupyter Notebooks

Jupyter is a web application that allows you to display and execute Python interactively. It’s listed here because it’s a user-to-user interface.

Users view Jupyter’s client interface—written in CSS, HTML, and JavaScript—in a web browser on the client machine. The client communicates with a a kernel written in Python (or a number of other languages) that executes blocks of code and responds with the result. Content is stored on the server machine in “notebook” (*.nb) format—text-only JSON divided into a series of “cells” that can contain HTML, Markdown (a human-readable markup language like what’s used on wiki pages), raw notes, or executable code. The server can be local (on the user’s own laptop), or remote like the sample notebooks at https://try.jupyter.org/.

The Jupyter server requires at least Python 3.3 and has been made compatible with Python 2.7. It comes bundled with the most recent versions of commercial Python redistributions (described in “Commercial Python Redistributions”) such as Canopy and Anaconda, so no further installation is required with these tools, provided you can compile and build C code on your system, as we ...

Get The Hitchhiker's Guide to Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.