The Jupyter Notebook is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text.
That means you can program CircuitPython in it! You can also use Jupyter Notebooks for many other programming tasks, including processingJS.
In fact, you should go through the “classic notebook” tutorial in python. It runs in your browser, so nothing to install: go try it, click on Try Classic Notebook. Go through each link in the Outline of some basics.
Installation for CircuitPython is mildly tedious. But, even I could do it. If you are using linux, you probably should use the anaconda install (because it needs certain versions of python3). The adafruit tutorial has an outdated link for anaconda, use this anaconda link instead.
In the adafruit tutorial, the “CPX_Blinka” example shows off a few things about Jupyter. It mixes code and explanation, including a picture. This makes it nice to document your code. You should work through the adafruit tutorial.
That grey box is live, runnable code! You’ll want to use the keyboard shortcuts, see the Help menu, Keyboard Shortcuts.
Jupyter is really just talking to the REPL. So, your program won’t be persistent. But, you can easily export the .py file and drop it into the “circuitpy” drive. Use %softreset very carefully.
“JupyterLab” is a fancier version (also at https://jupyter.org), able to mix different notebooks, and more.
Sharing Jupyter Notebooks
Adding the hooks to save a .py and .html may be useful.
github knows how to render a _static_ notebook. It will look right, but you can’t run any code. It may be possible to integrate github and jupyter using this thing.
Binder can make a notebook runnable (but not editable). For example, it can run a notebook in github. But, it can’t do CircuitPython.
Google Colab lets you put the notebook in a google-drive, and run it, edit, share. You can use normal google-drive access control. No version control. Can’t do CircuitPython