在ipdb上调试时,是否有命令在不需要使用断点的情况下停止循环(例如,for或while)?
我使用until命令从列表理解中跳出来,但不知道如何对整个循环块进行类似的操作。
发布于 2016-11-30 16:13:54
这听起来很明显:跳转使您跳过。这意味着您不执行跳转的行:您应该使用它跳过不想运行的代码。
您可能需要断点(临时断点,它在第一次命中时会自动删除)。这些参数和断续相同),就像我发现这个页面时一样。
发布于 2015-08-01 15:43:33
我相信这就是until命令的意图。它与next类似,只是当循环的前一行号发生跳转时,它将一直持续到退出循环为止。
unt(il)
Continue execution until the line with a number greater than the current
one is reached or until the current frame returns通常,要“跳出”当前函数,请使用return。
r(eturn)
Continue execution until the current function returns.发布于 2015-08-19 13:54:08
您可以使用j <line number> (jump)转到另一行。例如,j 28转到第28行。
https://stackoverflow.com/questions/31196818
复制相似问题