Emacs 中的 Python 解释器重复行 [英] Python Interpreter in Emacs repeats lines

查看:25
本文介绍了Emacs 中的 Python 解释器重复行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

发生了什么:

<预><代码>>>>2 * 102 * 1020>>>

我想要发生的事情:

<预><代码>>>>2 * 1020>>>

有谁知道为什么命令在执行之前被打印出来以及如何阻止它这样做?我找不到任何关于此的文档.我在 Mac OS X 上使用 Emacs 23 和 Python 2.7.

解决方案

我不使用 python,但我猜你使用的 python 特性已经设置了变量 comint-process-echoes 不正确.无论缓冲区中的值是什么,只需反转布尔值即可.

Comint 是 Emacs 中的支持库,用于在 Emacs 中运行劣质进程.它与提示交互,并且需要告诉 python shell(或 M-x shell)有关 echo 功能.

在有问题的 shell 缓冲区中,执行以下操作:

M-: (setq comint-process-echoes t) ;;或零

What is happening:

>>> 2 * 10
2 * 10
20
>>> 

What I want to happen:

>>> 2 * 10
20
>>> 

Does anyone know why the command is printed out before being executed and how to stop it from doing that? I can't find any documentation about this. I'm using Emacs 23 on Mac OS X with Python 2.7.

解决方案

I don't use python, but I would guess that the python feature you are using has set the variable comint-process-echoes incorrectly. Whatever the value in your buffer is, just reverse the boolean value.

Comint is a support library in Emacs for running inferior processes in Emacs. It interacts with the prompts, and the python shell (or M-x shell) needs to be told about the echo feature.

In your shell buffer with the problem, do:

M-: (setq comint-process-echoes t)  ;; or nil

这篇关于Emacs 中的 Python 解释器重复行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆