[英]How to stop infinite while loop python emacs
I wrote this code: 我写了这段代码:
x = 0
while x == 0:
print 'd'
When I type Cc! 当我输入抄送! and Cc Cc the code runs.
和Cc Cc代码运行。
Now the question is: How I stop the execution of that code? 现在的问题是:我如何停止执行该代码?
Many thanks for our answers. 非常感谢我们的答案。 Finaly I got the solution.
最后我得到了解决方案。 Here is my step by step how-to.
这是我一步一步的操作方法。
Credits to Omri Barel, Pavel Repin, jmdeldin 归功于Omri Barel,Pavel Repin,jmdeldin
Startpoint is: infinite while loop in pythontests.py file, 开始点是:pythontests.py文件中的无限循环,
In my case I got this message: 就我而言,我得到了这样的信息:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/tmp/python-4684wEr.py", line 3, in <module>
print 'd'
KeyboardInterrupt
And here is the screencast how it works: http://youtu.be/1MbfCHusF9c 以下是截屏视频的工作方式:http: //youtu.be/1MbfCHusF9c
Switch to the *Python*
buffer and type Cq Cc
to interrupt the script. 切换到
*Python*
缓冲区并键入Cq Cc
以中断脚本。 Cq
( quoted-insert
) is used to insert control characters because Cc
would be intercepted by Emacs. Cq
( quoted-insert
)用于插入控制字符,因为Cc
将被Emacs拦截。 It works in the shell modes too. 它也适用于shell模式。
我想你想要Cg停止运行当前命令。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.