IPython noteb中的pprint和ipdb

2024-03-28 13:12:15 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在学习如何使用ipdb调试器。我插入了一个断点,通过输入continue,我从一个断点前进到另一个断点。如果我想在两个断点之间执行一半的时候打印变量a的值,那么如何使用ipdb/pdb来实现呢?我试着打印和打印,但什么也没有出现。 enter image description here


Tags: 调试器pdb断点continueipdb
1条回答
网友
1楼 · 发布于 2024-03-28 13:12:15

您可以在IPDB控制台中使用ppp。在

来自pdb documentation

p expression

Evaluate the expression in the current context and print its value.

pp expression

Like the p command, except the value of the expression is pretty-printed using the pprint module

相关问题 更多 >