How Jupyter Works
Jupyter notebooks are a framework for sharing interactive computing across a variety of programming languages. They can run on your own machine, or be shared via the web. When used in conjunction with Binder, they become the interface for a web-accessed virtual computing environment. Here are our notebooks.
Interactive notebooks for running and sharing code have been a feature of certain computing languages for some time. The Jupyter Project emerged out of one such approach for sharing Python work, called ‘ipython’. The Wikipedia page (as so often with tech-based things) is quite good on the details.
When one starts a Jupyter notebook on her computer, the environment searches for ‘kernels’ that tells Jupyter what languages are available. Jupyter understands Julia, Python, and R (hence JU-PYT-R) by default. Other kernels can be installed. It then opens a browser based interface that includes a file manager (showing the files in the directory where we started Jupyter up, for a given session), a terminal window, and the notebook environment itself. When we click on ‘new’ we can select which kernel - which language - we want the notebook to be written in. Notebooks themselves are composed of ‘blocks’. Each block can be either a code block, or a text block (using the conventions of markdown, eg #
for headings, +
for bullets and so on). Each block can then be run by pressing the play button (a triangle icon) or stopped (the square icon). When a block is running or executing code, an asterisk appears to the left of the block. The results of a block are printed underneath the block. The notebooks may be saved. If they are uploaded to a repository in github, they will display correctly. (They will have the .ipynb
file extension).
A Github repository containing Jupyter notebooks can be shared using Binder. You give the URL to your Github repository to Binder, and Binder will in turn give you a unique URL to a virtual computer preloaded with the bits and pieces that will run your notebooks in a live environment. NB! Binder is still in beta, meaning, they’re still working out the kinks. A Binder environment will time out after 10 minutes of inactivity.
In ODATE, we link to the Bindered powered versions of our notebooks - even if you’re using a tablet, you can still run the code! If you wish to run them on your own machine, download Jupyter and get started.