2

I have variable called p and I want to print its value inside ipdb.

p = 100
breakpoint()  # DEBUG

ipdb> help p
p expression
        Print the value of the expression.

ipdb> p
*** SyntaxError: unexpected EOF while parsing

I can't to it since p has an alias inside ipdb. How can I force p to print its value?

alper
  • 2,919
  • 9
  • 53
  • 102

1 Answers1

1

You can use p p command and print function:

ipdb> p p
100
ipdb> print(p)
100
ndpu
  • 22,225
  • 6
  • 54
  • 69
  • It gives `*** TypeError: 'float' object is not iterable` error on my end even p is float value – alper May 25 '22 at 10:38
  • @alper i think you have that error in your code. I mean that there is no connection between that error and printing variable value in debugger... – ndpu May 25 '22 at 18:49
  • ah you are right, I have aliases p into `alias p pp dict(%1)` – alper May 25 '22 at 19:01