emacs python-mode:指定向哪个 python shell 发送命令
对此问题的跟进 - 如果我在 emacs 中运行两个 python shell,如何指定每个 python 脚本缓冲区中的哪些 shell 命令发送到?我怀疑它与 python-buffer 和 python-set-proc 有关,但将这些变量设置为 shell 的名称显然不是解决方案。
编辑:实际上,由于我使用的是python-mode
而不是loveshack python,所以它可能与python-buffer
和python-set-proc。
A follow up on this question - if I have two python shells running in emacs, how can I designate which shell commands from each python script buffer is sent to? I suspect it has something to do with python-buffer
and python-set-proc
but setting these variables to the name of the shell is apparently not the solution.
Edit: actually since I am using python-mode
rather than loveshack python, it probably does not have to do with python-buffer
and python-set-proc
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以为
python-buffer
设置一个新值。然后M-x
my-python-set-proc
RET*Python*
RET,或 M-x
my-python-set-proc
RET*Python*<2>;
RET。You can set a new value to
python-buffer
.And then M-x
my-python-set-proc
RET*Python*
RET,or M-x
my-python-set-proc
RET*Python*<2>
RET.在任何 Python 缓冲区中,您可以使用变量 py-which-bufname 来控制代码在执行时发送到哪个 Python shell。该变量是缓冲区本地的,因此为了将其设置为自定义值,您需要通过按
M-:
并输入以下内容从缓冲区内更改它,这也使您可以轻松地快速创建新进程缓冲区:如果将
py-which-bufname
设置为没有相应进程缓冲区的名称,则只需发出Cc!< /code> 快速创建一个。
华泰
In any Python buffer, you can use the variable
py-which-bufname
to control which Python shell your code gets sent to when executing it. The variable is buffer-local, so in order to set it to a custom value you'll need to change it from within the buffer by pressingM-:
and entering the followingThis also makes it easy to quickly create new process buffers: If you set
py-which-bufname
to a name for which there is no corresponding process buffer, you can just issueC-c !
to quickly create one.HTH
py-shell-name 设置默认值,该默认值可能会被命令覆盖。
如果缓冲区代码包含指定 pythonVERSION 的 shebang,则该值优先于默认设置。
您可以通过调用 py-execute-buffer-pythonVERSION 类的命令来通过特定的 pythonVERSION 强制执行缓冲区
请参阅菜单 PyExec,条目执行缓冲区 ...
py-shell-name sets the default, which might be overwritten by command
Should the buffer code contain a shebang specifying pythonVERSION , than this takes precedence over default setting.
You may enforce executing buffer through specific pythonVERSION by calling a command of class py-execute-buffer-pythonVERSION
See menu PyExec, entry Execute buffer ...