Inspect variables after exception in Python / Pydev / Eclipse

Is it possible to check variables on the stack after there is an uncaught exception in Python / Pydev / Eclipse? I would like to go back to the stack levels and see the local variables.

I suppose there are ways to hack this in Python, but is there an easy way in Eclipse?

+4
source share
1 answer

You do not need to “hack” this in python, you just use ipython:

ipython yourscript.py --pdb 

whenever "yourscript.py" crashes, you will end up in the ipython debugger where the exception was thrown. From there, you can move the stack up and down and check variables, etc. As needed. Thanks to ipython, you even get tab completion complete.

Of course, this is not Eclipse, but it is simple and incredibly useful when developing in Python.

+1
source

Source: https://habr.com/ru/post/1399390/


All Articles