I am trying to learn how to use the ipdb debugger. I inserted a breakpoint and by entering continue I advance from one breakpoint to another. If I want to print the value of the variable a while I am half way in the execution between the two breakpoints, how can I do this with ipdb/pdb? I tried print and pprint but nothing showed up.
Asked
Active
Viewed 2,558 times
5

Martijn Pieters
- 1,048,767
- 296
- 4,058
- 3,343

ROBOTPWNS
- 4,299
- 6
- 23
- 36
1 Answers
14
You can use p or pp in IPDB console.
From 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
-
`pp` is so useful `pp var` – Harry Moreno Jan 26 '23 at 19:46