我有一个名为 p
的变量,我想在 ipdb
中打印它的值.
p = 100
breakpoint() # DEBUG
ipdb> help p
p expression
Print the value of the expression.
ipdb> p
*** SyntaxError: unexpected EOF while parsing
我不能这样做,因为 p 在 ipdb
中有一个别名。如何强制 p
打印其值?
最佳答案
您可以使用p p
命令和print
功能:
ipdb> p p
100
ipdb> print(p)
100
关于python - 如何在 ipdb 中打印 p 变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70480093/