How to cancel an interpreter command in emacs python-mode

If I make a mistake in a command in intepreter python, sometimes I just see .... For example, if I type help(random.unifand press enter, I cannot enter a new command. I need to exit emacs and run python and interpreter again. Is there any way to fix this?

+5
source share
2 answers

As Pavel Anosov explains, you want to send Python to CTRL-C to abort it.

But in emacs, the default CTRL-Cis a prefix key.

, , python-mode , CTRL-C ctrl-C . , , CTRL-C CTRL-C comint-interrupt-subjob. (, - META-X comint-interrupt-subjob, .) :

Python 2.7.2 (default, Jun 20 2012, 16:23:33) 
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> help(f
...   ^C ^C
KeyboardInterrupt
>>> 

quoted-insert, CTRL-Q, CTRL-C. , , . :

Python 2.7.2 (default, Jun 20 2012, 16:23:33) 
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> help(f
... ^C
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyboardInterrupt
>>> 
+5

CTRL-C. emacs. , ( , )).

+1

All Articles