Jupyter: Difference between revisions
From charlesreid1
No edit summary |
|||
| Line 10: | Line 10: | ||
===Pickling things with Dill=== | ===Pickling things with Dill=== | ||
See [[Jupyter/Dill]] for use of dill to pickle stuff. | |||
The dill library adds pickling/serialization abilities to the ipython parallel functionality. | The dill library adds pickling/serialization abilities to the ipython parallel functionality. | ||
Revision as of 13:39, 27 November 2017
Jupyter Notebooks
(There is some old information on the Ipython page but this is the one that's updated regularly)
Jupyter Notebooks provide access to the Python programming language through a web browser interface.
Running code in parallel with ipyparallel
See Jupyter/MPI for instructions on setting up and running code in parallel using Jupyter notebooks.
Pickling things with Dill
See Jupyter/Dill for use of dill to pickle stuff.
The dill library adds pickling/serialization abilities to the ipython parallel functionality.
Setting up password-protected Jupyter notebook
If you just want a single-user password-protected Jupyter notebook, you can modify Jupyter's config file, jupyter_notebook_config.py, to contain a hashed password. Then, when you run it, Jupyter will load the configuration file and password-protect the notebook that it starts up. Here's how to do that:
Create config file
Start by running a Jupyter command that will create a new, empty config file:
$ jupyter notebook --generate-config
The file it creates is called jupyter_notebook_config.json. Once you generate the hashed password, this is where you'll add it.
Generate hashed password
You can generate a hashed password by interactively entering your password on the command line, live:
$ jupyter notebook password Enter password: ******* Verify password: ******* [NotebookPasswordApp] Wrote hashed password to /Users/you/.jupyter/jupyter_notebook_config.json
Alternatively, you can generate the hash yourself, or in a script, using components of Juypter notebook from a Python script:
>>> from notebook.auth import passwd >>> passwd() Enter password: Verify password: 'sha1:8c8fe60bb8b6:ccf9ede0825894254b2e042ea597d77107ee11abd'
Or from a Python script:
from notebook.auth import passwd
passwd('the_worst_password_in_the_world')