如何在 Pycharm 中调试 [英] How to debug in Pycharm
问题描述
我需要在 Pycharm 中调试一些特别的东西吗?
Is there something special I need to debug in Pycharm?
我有以下代码:
def main():
print "Hello World"
if __name__ == "__main__":
main()
我在每个上都有断点.我点击了调试,它给了我一些窗口并打印了两行,即使我在每一行上都有断点.遇到断点时是否有任何指示?
and I have breakpoints on each. I hit Debug and it gives me some windows and prints both lines even though I have breakpoints on each. Is there any kind of indicator when a breakpoint is hit?
我在其他帖子中看到过一些关于您必须如何首先设置配置的内容?但似乎没有一个帖子提到如何.这是我的配置
I have seen in other posts something about how you must setup your configuration first? But none of the posts seem to mention how. Here is my configuration
请不要在这里链接我:https://www.jetbrains.com/pycharm/help/debugging.html 我读过它,但不明白我需要做什么.我不断收到诸如以下内容的提示:
Please do not link me here: https://www.jetbrains.com/pycharm/help/debugging.html I have read it and do not understand what I need to do. I keep getting reffered to lines such as:
在项目结构对话框中,配置根目录、依赖项和要传递给解释器的库.
In the Project Structure dialog box, configure the roots, dependencies and libraries to be passed to the interpreter .
我是 Python 新手,不确定应该在框中输入什么.
I am new to python and am not sure what I should be inputting into the boxes.
所以我的问题是真的.
- Pycharm 是否应该开箱即用地调试 Python?
- 如果没有,我该如何设置 Pycharm 来调试 Python.
我使用的是几分钟前全新安装的最新 python 2.7.9.
I am using the latest python 2.7.9 a fresh install of a few minutes ago.
推荐答案
事实证明我只是个白痴.虽然我在调试菜单中看到有人抱怨同样的问题.
Well it turns out I am just a idiot. Though I have seen people in the debug menu complaining about the same problem.
您正在调试.断点不会更改以表明您已像 Visual Studio 一样点击该行.相反,您的一行会变成浅蓝色(取决于您的主题),以表明您正在调试该行.
You are debugging. The breakpoint does not change to indicate you have hit that line like visual studio. Instead one of your lines will change a light blue (depending on your theme) to indicate you are debugging that line.
这篇关于如何在 Pycharm 中调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!