How to use the green quot;Attach Debuggerquot; button in Python console using PyCharm(如何使用绿色的“附加调试器使用 PyCharm 的 Python 控制台中的按钮)
问题描述
我想知道如何使用 Python 控制台左侧的这个绿色错误按钮.我已经搜索过官方文档,但似乎没有这个按钮的描述.注意我问的是左侧的按钮,而不是右上角的按钮.
I was wondering how to use this green bug button on the left side of Python console. I've been searched official documents but there seems to be no description of this button. Note I am asking the button on the left side, not the button on the right top corner.
我正在使用 IPython 控制台,发现 %debug
魔法不再可用.我想知道该按钮的用途以及如何在 IPython 控制台中使用 %debug
魔法.
I'm using IPython console and found %debug
magic is not available anymore. I'd like to know what's the usage of that button and how to use %debug
magic in IPython console.
推荐答案
我自己找答案的时候发现了你的问题;最终我发现了这个视频,它显示它正在使用中:https://www.youtube.com/watch?v=JcOCNgXXhmE
I found your question while searching for the answer myself; eventually I hit upon this video that shows it in use: https://www.youtube.com/watch?v=JcOCNgXXhmE
基本上,您必须在正在编辑的文件中设置断点,在控制台中导入文件,单击附加调试器"按钮,然后运行遇到断点的代码——此时,调试器工具将打开,您可以单步执行.
Basically, you have to set a breakpoint in a file you're editing, import the file in the console, click the "Attach Debugger" button and then run code that hits the breakpoint -- at that point, the debugger tool will open and you can step through it.
这不是我所希望的完全——我希望附加调试器,然后逐步执行我刚刚键入的语句,就像使用 IPython 的 %debug <statement>
(仍然有效,但不提供视觉效果).
It's not exactly what I was hoping for -- I was hoping to attach the debugger and then step through a statement I'd just typed, as one can with IPython's %debug <statement>
(which still works, but does not provide the visual niceties).
为此我找到的最佳解决方案是使用临时文件,键入我要逐步执行的语句,然后使用它运行调试器.
The best solution I've found for that is to use a scratch file, type the statement I want to step through, then run the debugger with that.
这篇关于如何使用绿色的“附加调试器"使用 PyCharm 的 Python 控制台中的按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何使用绿色的“附加调试器"使用 PyCharm 的


基础教程推荐
- 包装空间模型 2022-01-01
- Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙? 2022-01-01
- 在Python中从Azure BLOB存储中读取文件 2022-01-01
- PermissionError: pip 从 8.1.1 升级到 8.1.2 2022-01-01
- 修改列表中的数据帧不起作用 2022-01-01
- 无法导入 Pytorch [WinError 126] 找不到指定的模块 2022-01-01
- 在同一图形上绘制Bokeh的烛台和音量条 2022-01-01
- 求两个直方图的卷积 2022-01-01
- 使用大型矩阵时禁止 Pycharm 输出中的自动换行符 2022-01-01
- PANDA VALUE_COUNTS包含GROUP BY之前的所有值 2022-01-01