我可以让pdb立即开始调试吗?
我想调试一个Python项目
问题是,我不知道在哪里设置断点,
我想要做的是能够调用一个方法
SomeClass( some_ctor_arguments ).some_method()`
并立即触发调试器
我该怎么做?
我尝试了 pdb.run( string_command )
但它似乎无法正常工作
>>> import pdb
>>> import <some-package>
>>> pdb.run( .... )
> <string>(1)<module>()
(Pdb) s
NameError: "name '<some-package>' is not defined"
I want to debug a python project
The problem is, I don't know where to set a break point,
what I want to do, is be able to call a method
SomeClass( some_ctor_arguments ).some_method()`
and have the debugger be fired right away
How do I do that?
I tried pdb.run( string_command )
but it doesn't seem to work right
>>> import pdb
>>> import <some-package>
>>> pdb.run( .... )
> <string>(1)<module>()
(Pdb) s
NameError: "name '<some-package>' is not defined"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
找到了 ..
Found it ..
此时将启动调试器。
将其放在要调试的方法的开头。
will start the debugger at this point.
Place it at the beginning of the method you want to debug.