Where can I run a startup script in Jupyter?

I am looking for a way to run my script run in Jupyter. In IPython, I put it under $IPYTHON_DIR/profile_default/startup/.

In Jupyter, it seems that the configuration file should be $JUPYTER_CONFIG_DIR/jupyter_notebook_config.py. However, I would like to use my boot file, which imports many Python libraries at kernel startup.

Where can I put such a file in Jupyter?

+4
source share
1 answer

You can get the default startup folder of the script through this in a jupyter laptop:

get_ipython().profile_dir.startup_dir

On my windows pc folder: C:\Users\myusername\.ipython\profile_default\startup

And read the README file in the folder.

    Files will be run in lexicographical order, so you can control
the execution order of files with a prefix, e.g.::

    00-first.py
    50-middle.py
    99-last.ipy

So, you can put the file under the name 00-xx.pyin the folder.

0
source

Source: https://habr.com/ru/post/1684228/


All Articles