Reputation: 161
I wrote this code:
x = 0
while x == 0:
print 'd'
When I type C-c! and C-c C-c the code runs.
Now the question is: How I stop the execution of that code?
Upvotes: 4
Views: 3033
Reputation: 161
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
Startpoint is: infinite while loop in pythontests.py file,
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
Upvotes: 4
Reputation: 5404
Switch to the *Python*
buffer and type C-q C-c
to interrupt the script. C-q
(quoted-insert
) is used to insert control characters because C-c
would be intercepted by Emacs. It works in the shell modes too.
Upvotes: 2
Reputation: 8200
I think you want C-g which will stop running the current command.
Upvotes: 0