Menu ▾ ▴

Console usage during debugging

Fireball
2008-06-17
2013-03-15
  • Fireball

    Fireball - 2008-06-17

    When I'm debugging a python program using PyDev Extensions and I am stopped at a breakpoint, I should be able to compute and display values of python expressions in the console using variables that are in scope at the breakpoint.

    The above works, however, I need to type two <return>s after I type the expression into the console in order to get the console to print the value of the expression.

    Why is this? I'm used to other IDE's in which just typing the expression followed by a single <return> prints the value of the expression. Is there any way to configure PyDev Extensions so that a single <return> suffices?

     
    • Fabio Zadrozny

      Fabio Zadrozny - 2008-06-18

      There's currently no such option (although there's a request for it already... it probably won't get on 1.3.18, but I'm hoping on getting it on the next release).

      It's currently that way because it accepts multi-line statements, so that it can know when to evaluate something...

      E.g.: You could write
      for i, s in enumerate(xx):
      ....print i + '.' + a

      and it would correctly evaluate the whole block at once (whereas doing it line by line wouldn't work).

      So, I'm thinking on a good heuristic to know when to evaluate it all at once... maybe it could search for ':' to know that the statement hasn't finished or have the user specify an ending char (e.g: '\') to know that it should wait for the next evaluation -- still not sure on the best approach -- but I guess that taking a look on how the python interpreter does it might be a good alternative ;-).

      Cheers,

      Fabio