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

查看:29
本文介绍了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.

您需要设置 c.TerminalInteractiveShell.editor,它在您的 ipython_config.py 中.我不太确定它在 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天全站免登陆