如何配置emacs以使用ipython

时间:2014-10-01 06:23:41

标签: emacs ipython python-mode

我正在使用ubuntu 14.04,emacs 24.3.1,python 2.7.6,ipython 1.2.1,python-mode 6.1.3。 Ipython在emacs中运行良好至少一年,但是,两周前我遇到了以下问题。

  1. 使用C-c!为了启动默认解释器,ipython按照我的希望显示,但它不是在另一个窗口中拆分框架和显示,而是出现在原始代码窗口中。 (这是一个小问题)
  2. 使用C-c |执行一个区域, python解释器启动,代码发送到python解释器而不是ipython解释器
  3. 我搜索了SO,但这个问题似乎太近了,无法得到答案。我用Google搜索,找到了这个页面https://answers.launchpad.net/python-mode/+question/250905,尝试了其中的方法,仍然无法正常工作......任何人都可以帮我解决问题吗?非常感谢!

    我的.emacs python部分看起来像

        (require 'python-mode)
        (setq-default py-shell-name "ipython")
        (setq-default py-which-bufname "IPython")
        ; switch to the interpreter after executing code
        (setq py-shell-switch-buffers-on-execute-p t)
        (setq py-switch-buffers-on-execute-p t)
        ; don't split windows
        (setq py-split-windows-on-execute-p nil)
    

1 个答案:

答案 0 :(得分:1)

为了拆分窗口

(setq py-split-windows-on-execute-p t)

需要

,分别是。重置为默认值 - 示例中的最后一行。也许通过M-x自定义检查设置...也可能与init的setq冲突。

选择shell执行时:缓冲区中的shebang可能会覆盖默认的py-shell-name。 如果应该忽略shebang,请使用

(setq py-force-py-shell-name-p t)

参见菜单

的Python /定制/开关/翻译

在当前会话期间轻松更改此值。

相关问题