IPython笔记本的外部编辑器 [英] External editor for IPython notebook

查看:97
本文介绍了IPython笔记本的外部编辑器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用IPython笔记本,我想在外部编辑器中编辑程序。
如何获取%edit file_name.py 以打开Notepad ++等编辑器。

I am using IPython notebook and I want to edit programs in an external editor. How do I get the %edit file_name.py to open an editor such as Notepad++.

推荐答案

运行%edit?会为你提供%edit 魔法的帮助函数。

Running %edit? will give you the help for the %edit magic function.

您需要在ipython_config.py中设置 c.TerminalInteractiveShell.editor 。我不太确定它在Windows中的位置;在OS X和Linux上,它位于〜/ .ipython中。您需要将变量设置为所需编辑器的完整路径。

You need to set c.TerminalInteractiveShell.editor, which is in your ipython_config.py. I'm not quite sure where this is located in Windows; on OS X and Linux, it is in ~/.ipython. You'll want to set the variable to be the full path of the editor you want.

或者,您可以在Windows中创建环境变量EDITOR,并将其设置为等于你想要的编辑器的完整路径。 iPython应该使用它。

Alternatively, you can create an environment variable EDITOR in Windows itself, and set that equal to the full path of the editor you want. iPython should use that.

这篇关于IPython笔记本的外部编辑器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆