如何在 emacs 中打开 IPython 解释器? [英] How to open IPython interpreter in emacs?
问题描述
为了在Emacs的Python开发过程中使用IPython,我打开了一个终端,输入ipython
.这似乎不是正确的做法.
In order to use IPython during Python development in Emacs, I have been opening up a terminal, and typing ipython
. This doesn't seem like the right way to do it.
一方面,我的缓冲区将此缓冲区列为 *ansi-term*
,这令人困惑,因为我经常以多个终端结束,其中一个专用于 Python.我还看到我可以用 M-x python-shell
直接打开一个 python 解释器.似乎 IPython 应该有类似的选项.
For one thing, my buffer lists this buffer as *ansi-term*
, which is confusing, as I often end up with multiple terminals, one of which is dedicated to Python. I also see that I can open a python interpreter directly with M-x python-shell
. It seems like there ought to be a similar option for IPython.
有没有更好的方法在 Emacs 中使用 IPython 解释器?
Is there a better way to use the IPython interpreter in Emacs?
我将 Emacs 24 与 Prelude 一起使用.
I'm using Emacs 24 with Prelude.
推荐答案
我不知道 Prelude 是什么,但如果你能安装最新的 Emacs(即包含 Fabian 的 python-mode 的 Emacs),那么你可以使用以下让 Python 模式知道您首选的解释器.然后你只需要调用M-x run-python
:
I don't know what Prelude is, but if you can install the latest Emacs (i.e, Emacs with Fabian's python-mode included), then you can use the following to let Python mode know your preferred choice of interpreter. Then you just need to call M-x run-python
:
--
(when (executable-find "ipython")
(setq python-shell-interpreter "ipython"))
--
这篇关于如何在 emacs 中打开 IPython 解释器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!