我在哪里可以在Jupyter中放置启动脚本?

Bla*_*ard 10 python startup jupyter-notebook

我正在寻找一种方法将我的启动脚本放在Jupyter中.在IPython中,我把它放在了$IPYTHON_DIR/profile_default/startup/.

在Jupyter中,似乎配置文件应该是$JUPYTER_CONFIG_DIR/jupyter_notebook_config.py.但是,我想使用我的启动文件,它在内核启动时导入了大量的Python库.

我在哪里可以把这个文件放在Jupyter中?

kin*_*ase 11

您可以通过以下代码在jupyter笔记本中获取默认的启动脚本文件夹:

get_ipython().profile_dir.startup_dir
Run Code Online (Sandbox Code Playgroud)

在我的Windows PC上,该文件夹为: C:\Users\myusername\.ipython\profile_default\startup

并阅读该文件夹下的自述文件。

    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
Run Code Online (Sandbox Code Playgroud)

因此,您可以在文件00-xx.py夹下放置一个名为的文件。

  • 有什么方法可以使其成为“项目”文件夹或类似文件夹的本地文件夹吗? (3认同)