且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在循环python emacs中停止无限循环

更新时间:2022-05-06 22:11:53

非常感谢您的回答。最终我得到了解决方案。这是我的分步操作方法。

Many thanks for our answers. Finaly I got the solution. Here is my step by step how-to.

Omri Barel,Pavel Repin,jmdeldin的信用额

起点是:pythontests.py文件中的while循环,

Startpoint is: infinite while loop in pythontests.py file,


  1. Cc! (打开python shell)(您看到两个窗口 buffers,光标位于python shell中)

  2. Cx o(切换到其他窗口 buffer)(现在是pythontests。 py文件高亮显示)

  3. 抄送CC(执行代码)(行开始移动并计数:))

  4. Cx o(切换到其他窗口缓冲区)(现在是python shell高亮显示)

  5. Cc Cc(停止运行进程)(现在您看到引用消息)

  1. C-c ! (open the python shell)(you see two windows "buffers", cursor is in the python shell)
  2. C-x o (switch to other window "buffer") (now is the pythontests.py file highlited)
  3. C-c C-C (execute the code)(the lines begin to move and count :))
  4. C-x o (switch to other window "buffer") (now is the python shell highlited)
  5. C-c C-c (stops running process) (now you see the Trackback message)

在我的情况下,我收到此消息:

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

这是截屏视频: http://youtu.be/1MbfCHusF9c