【发布时间】:2018-03-28 06:03:45
【问题描述】:
我需要在另一个脚本中使用 jupyter 本地目录的位置。例如,在启动 jupyter 时,控制台会打印:
> Serving notebooks from local directory: C:\Users\PC\Documents
不知何故,jupyter 已将此路径设置为提供我的笔记本的默认本地位置。它是我的 jupyter 环境的“根”。如何找到此默认设置?是否有我可以解析的预先存在的文件,或者我可以输入的命令?
在其他尝试中,我尝试了以下方法:
> jupyter notebook --help-all
--NotebookApp.notebook_dir=<Unicode>
Default: ''
The directory to use for notebooks and kernels.
注意:我没有配置文件,也不想通过generate a config file 获取此信息。为了清楚起见,我不关心changing the directory。
【问题讨论】:
-
你是如何开始 Jupyter 的?路径
C:\Users\PC\Documents是不变的还是不同的? -
@JacobBudin 我使用 Anaconda 的 JupyterNotebook 链接启动 jupyter,因此是的,它始终是一个可重复的开始。但是,它似乎运行
jupyter-notebook-script.py,它调用notebook.notebookapp。那里可能有解析本地目录的代码。