问题描述
我刚开始使用IPython Notebook,我尝试使用保存来保存我的进度。但是,不是将* .ipynb保存在我当前的工作目录中,而是保存在我的python / Scripts文件夹中。有没有办法设置这个?
I just started IPython Notebook, and I tried to use "Save" to save my progress. However, instead of saving the *.ipynb in my current working directory, it is saved in my python/Scripts folder. Would there be a way to set this?
谢谢!
推荐答案
是,您可以在配置文件配置中指定笔记本位置。由于它没有将它们保存到您启动笔记本的目录中,因此我假设您在配置文件中设置了此选项。您可以使用以下命令查找配置文件目录的路径:
Yes, you can specify the notebooks location in your profile configuration. Since it's not saving them to the directory where you started the notebook, I assume that you have this option set in your profile. You can find out the the path to the profiles directory by using:
$ ipython locate
在默认配置文件或您使用的配置文件中,编辑 ipython_notebook_config.py
文件并更改行:
Either in your default profile or in the profile you use, edit the ipython_notebook_config.py
file and change the lines:
注意:如果您没有配置文件,或者配置文件文件夹不包含 ipython_notebook_config.py
文件,使用 ipython个人资料创建
。
Note: In case you don't have a profile, or the profile folder does not contain the ipython_notebook_config.py
file, use ipython profile create
.
# The directory to use for notebooks.
c.NotebookManager.notebook_dir = u'/path/to/your/notebooks'
和
# The directory to use for notebooks.
c.FileNotebookManager.notebook_dir = u'/path/to/your/notebooks'
如果您想将笔记本保存在当前目录中,或者只是将它们注释掉。
Or just comment them out if you want the notebooks saved in the current directory.
更新(2014年4月11日):在IPython 2.0中配置文件中的名称已更改,现在就是:
Update (April 11th 2014): in IPython 2.0 the property name in the config file changed, so it's now:
c.NotebookApp.notebook_dir = u'/path/to/your/notebooks'
这篇关于IPython笔记本保存位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!