gpt4 book ai didi

python - 在 emacs 中打开第二个 python 解释器

转载 作者:太空宇宙 更新时间:2023-11-03 15:18:42 25 4
gpt4 key购买 nike

如何在 emacs 中打开第二个 python 解释器?我正在使用 emacs 24.3 和 Ubuntu 12.04 LTS。我已经通过前缀参数 2 打开了 SQL 解释器/程序。我用 python 尝试了这个,但没有成功。

欢迎提出任何建议和想法。我当前的 python 解释器缓冲区中的模式说:Inferior Python: run Shell-Compile 我已经从 ELPA emacs 包管理器下载了 python-mode 6.10。

感谢大家的帮助!

最佳答案

M-x describe-function (RET) 运行python:

run-python is an interactive compiled Lisp function in `python.el'.

(run-python &optional CMD NOSHOW NEW)

Run an inferior Python process, input and output via buffer Python. CMD is the Python command to run. NOSHOW non-nil means don't show the buffer automatically.

Interactively, a prefix arg means to prompt for the initial Python command line (default is `python-command').

A new process is started if one isn't running attached to python-buffer', or if called from Lisp with non-nil arg NEW.
Otherwise, if a process is already running in
python-buffer', switch to that buffer.

...

*scratch* 缓冲区中:

(run-python nil nil 't)

这将为您提供一个新的劣质 Python 进程。

您可以在您的 .emacs 文件中编写一个新的交互式 emacs 命令,例如:

(defun my-run-python ()
(interactive)
(run-python nil nil 't))

关于python - 在 emacs 中打开第二个 python 解释器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18347706/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com