on master help sign in
project-m36/docs/jupyter_kernel.markdown
49 lines 1.9 kB history raw
1# TutorialD Jupyter Kernel for Project:M36
3## Introduction
5[The Jupyter Notebook](https://jupyter-notebook.readthedocs.io/en/stable/notebook.html) is web-based tool for experimenting with various languages. Project:M36 offers a Jupyter kernel for the TutorialD interpreter.
7The kernel automatically starts and stops its own websocket-server-based database and offers no filesystem persistence, which is similar to other jupyter kernels.
9## Installation
11To install the `tutd` kernel:
13* install the `itutd` module into your jupyter virtual environment:
14```
15$ cd project-m36/jupyter/itutd
16$ pip install .
17```
19* install `kernel.json`:
21 ```$ mkdir ~/Library/Jupyter/kernels/itutd && cp project-m36/jupyter/kernel.json ~/Library/Jupyter/kernels/itutd``` (macOS)
23 ```$ mkdir ~/.local/share/jupyter/kernels/tutd && cp project-m36/jupyter/kernel.json ~/.local/share/jupyter/kernels/tutd``` (Linux)
25 ```$ mkdir %APPDATA%\jupyter\kernels\tutd && copy project-m36\jupyter\kernel.json %APPDATA%\jupyter\kernels\tutd``` (Windows)
27* check that the kernel is detected:
28```
29$ jupyter kernelspec list
30Available kernels:
31 python2 ...
32 tutd ...
33```
35* add `project-m36-server` to `PATH` environment variable
37```
38$ export PATH=$PATH:<path/to/project-m36-websocket-server>
39$ which project-m36-websocket-server
40/path/to/project-m36-websocket-server
41```
43From within this python virtual environment, you can now start jupyter with TutorialD support.
45## Usage
47With the kernel installed, run `jupyter notebook` for the web-based interface and click "New" at the top right of the page. The TutorialD kernel should be in the list.
49Once a new TutorialD notebook is opened, the interpreter is identical to the `tutd` command line interpreter and accepts the same commands. If you are new to Project:M36-flavored TutorialD, please [read the tutorial](/docs/tutd_tutorial.markdown).