如何在IDLE中向Python程序添加断点? [英] How do you add breakpoints to a Python program in IDLE?
问题描述
我已经解决了这个问题,我只是将其发布在这里,因为我无法通过Google或阅读文档来解决。我只是偶然发现了它。
I solved this already, I'm just posting it here because I couldn't figure it out with google, or by reading the docs. I only found it by accident.
要添加断点,请右键单击要在其上添加断点的行,然后选择设置断点 。该行将突出显示。 (请注意,这仅在编辑文件时才起作用;在解释器中不起作用。)
To add a breakpoint, right-click on the line that you want to add a breakpoint on and select "Set Breakpoint". The line will become highlighted. (Note that this only works when you are editing a file; it does not work at the interpreter.)
此网站提供了有关使用IDLE调试器的详细教程。
This site has a detailed tutorial about using the IDLE debugger.
在Mac上,您需要按住Control键单击而不是右键单击。
On Mac, you need to Control-click instead of right clicking.
推荐答案
完成OP提供的答案:设置断点后-您必须打开IDLE的调试模式(使用debug-> debugger)。运行程序时,在打开的调试窗口中按 Go,然后IDLE将在断点处停止。
Completing the answer supplied by the OP: after setting the breakpoint - you must turn on IDLE's debug mode (using debug --> debugger). When you run the program, press "Go" in the debug window that opens up and IDLE will stop at the breakpoint.
这篇关于如何在IDLE中向Python程序添加断点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!