Do You know the feeling of being already late to a party when encountering something new?
But when you actually start telling others about it, You realize that it is not too common sense at all, e.g. JuPyter Notebooks.
What is a JuPyter notebook?
In my own words: a browser-based document-oriented command line style exploration tool for python. Huh!
Ok, let’s break it down:
JuPyter is a client-server concept where you edit your code in a web form in a browser. You send the input of a cell to the server backend for execution and the server sends back a response which will be rendered in your browser.
On great aspect of a JuPyter is that You can enrich your code in a nice fashion with headlines and markdown code so that you have a document containing code, the result of the code execution and documentation.
Installation and Run
If You already have a python installation You can use pip to install JuPyter
pip install jupyter pip install ipython ipython kernal install
After installation you can start it on the console with:
An alternative way is to use the anaconda distribution.
On big drawback -when your background is SW development- is that You don’t have code completion.
Another disadvantage: modularization of your code is not easy.
Versioning is an issue as well. Because the Jupyter notebook’s json files contains code and generated artifacts like plots every re-run of a notebook changes the file. The diff is not easily comprehensible.
For the code completion issue there is JetBrains for the rescue: PyCharm IDE has an integrated JuPyter editor which supports code completion.
Useful Keyboard Shortcuts
Ctrl + Enter: Run Cell
Alt + Enter: Run Cell and insert new cell below