【发布时间】:2008-09-29 19:55:12
【问题描述】:
你在 Python 源代码中插入了什么来让它进入 pdb(当执行到达那个位置时)?
【问题讨论】:
标签: python debugging breakpoints pdb
你在 Python 源代码中插入了什么来让它进入 pdb(当执行到达那个位置时)?
【问题讨论】:
标签: python debugging breakpoints pdb
import pdb; pdb.set_trace()
请参阅 Python: Coding in the Debugger for Beginners 了解更多有用的提示。
【讨论】:
从 Python 3.7 开始,您可以使用 breakpoint() - https://docs.python.org/3/library/functions.html#breakpoint
【讨论】: