5

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. enter image description here

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
ROBOTPWNS
  • 4,299
  • 6
  • 23
  • 36

1 Answers1

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

Community
  • 1
  • 1
Mr.Teapot
  • 141
  • 2
  • 6