Difference between revisions of "Python/Jupyter Notebook"
< Python
Jump to navigation
Jump to search
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
= Install = | |||
There is a many methods to get Jupyter Notebook. Below my preferred option to run in Vagrant. | |||
== Vagrant == | |||
<source lang=bash> | |||
git clone https://gitlab.com/pio2pio/vagrant-jupyther-box | |||
cd vagrant-jupyther-box | |||
vagrant up | |||
firefox http://localhost:8888 | |||
</source> | |||
= Run <code>[https://docs.python.org/3/library/turtle.html turtle graphics]</code> in Jupyter Notebook = | |||
The turtle module, which allows you to create images using turtle graphics. Follow steps below to enable running in JN: | |||
Option 1 | |||
<source> | |||
git clone https://github.com/takluyver/mobilechelonian | |||
cd mobilechelonian/ | |||
pip install -e . | |||
>>> Successfully installed mobilechelonian | |||
</source> | |||
Example Turtle code | |||
<source lang=python> | |||
from mobilechelonian import Turtle | |||
t = Turtle() | |||
t.shape('turtle') | |||
</source> | |||
Option2 - hasn't worked | |||
<source> | |||
# Prep | |||
$ pip install ipyturtle | |||
$ jupyter nbextension enable --py --sys-prefix ipyturtle | |||
# Project | |||
$ git clone https://github.com/gkvoelkl/ipython-turtle-widget.git | |||
$ cd ipython-turtle-widget | |||
$ sudo apt install npm | |||
$ pip install -e . | |||
$ jupyter nbextension install --py --symlink --sys-prefix ipyturtle | |||
$ jupyter nbextension enable --py --sys-prefix ipyturtle | |||
</source> | |||
You can see now the sketch right below the cell. | |||
= References = | = References = | ||
* [https://jupyter.org/install.html Installing the Jupyter Software] | * [https://jupyter.org/install.html Installing the Jupyter Software] | ||
* [https://www.brow.sh/docs/keybindings/ Browsh fully-modern text based web browser] brow.sh | * [https://www.brow.sh/docs/keybindings/ Browsh fully-modern text based web browser] brow.sh | ||
* [https:// | * [https://gitlab.com/pio2pio/vagrant-jupyther-box jupyter-vagrant-box] GitLab |
Latest revision as of 00:12, 23 March 2020
Install
There is a many methods to get Jupyter Notebook. Below my preferred option to run in Vagrant.
Vagrant
git clone https://gitlab.com/pio2pio/vagrant-jupyther-box cd vagrant-jupyther-box vagrant up firefox http://localhost:8888
Run turtle graphics
in Jupyter Notebook
The turtle module, which allows you to create images using turtle graphics. Follow steps below to enable running in JN:
Option 1
git clone https://github.com/takluyver/mobilechelonian cd mobilechelonian/ pip install -e . >>> Successfully installed mobilechelonian
Example Turtle code
from mobilechelonian import Turtle t = Turtle() t.shape('turtle')
Option2 - hasn't worked
# Prep $ pip install ipyturtle $ jupyter nbextension enable --py --sys-prefix ipyturtle # Project $ git clone https://github.com/gkvoelkl/ipython-turtle-widget.git $ cd ipython-turtle-widget $ sudo apt install npm $ pip install -e . $ jupyter nbextension install --py --symlink --sys-prefix ipyturtle $ jupyter nbextension enable --py --sys-prefix ipyturtle
You can see now the sketch right below the cell.