如何在不启动Jupyter Notebook服务器的情况下使用.ipynb文件? [英] How to work with .ipynb files without launching the Jupyter Notebook server?
问题描述
我开始更多地使用Jupyter笔记本,并且真的开始喜欢它.但是,我发现很难在我的特定设置中使用它.
I'm starting to work more with Jupyter notebooks, and am really starting to like it. However, I find it difficult to use it with my particular setup.
我有一台可以运行所有笔记本电脑的工作站,但是在一天的大部分时间里,我一直在忙于一台空间狭窄且没有电源插座的笔记本电脑.我希望能够在不安装和运行完整Jupyter服务器后端的情况下编辑(但不能运行)这些笔记本,我想这会消耗很多功能.
I have a workstation for running all the notebooks, but for a large part of my day I'm on-the-go with a space-constrained laptop with no power outlets. I'd like to be able to edit (but not run) these notebooks without installing and running the full Jupyter server backend, which I imagine would suck up a lot of power.
我的问题是:是否可以在不运行Jupyter服务器的情况下编辑(而不运行)笔记本?
My question is: Is it possible for me to edit (and not run) notebooks without running the Jupyter server?
推荐答案
您可以使用以下选项之一
You could use one of the following options
使用此模块,您可以从.py转换为.ipynb,反之亦然:
With this module you can do a conversion from .py to .ipynb and vice-versa:
ipynb-py-convert ~/name_of_notebook.ipynb ~/name_of_notebook.py
根据文档,单元格保持原样.找回Jupyter笔记本
where according to the documentation the cells are left as they are. To get back a jupyter notebook
ipynb-py-convert ~/name_of_notebook.py ~/name_of_notebook.ipynb
2. IPython的
但是,如果您想通过VS Code或Sublime Text这样的编辑器来使用.apy =".https://ipython.readthedocs"下载.ipynb文件,也可以将其转换为.py. .io/en/1.x/interactive/nbconvert.html"rel =" nofollow noreferrer> ipython :
ipython nbconvert --to python name_of_your_notebook.ipynb
这篇关于如何在不启动Jupyter Notebook服务器的情况下使用.ipynb文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!