I would like to be able to drop to the python REPL from the debugger -- if this is not possible is there an easier way to evaluate python expressions in the context of the current breakpoint other than manually adding them all as watch expressions?
+4
A:
I don't use pydev, but to drop to python's interactive REPL from code:
import code
code.interact(local=locals())
To drop to python's debugger from code:
import pdb
pdb.set_trace()
Finally, to run a interactive REPL after running some code, you can use python's -i
switch:
python -i script.py
That will give you a python prompt after the code, even if it throws an exception.
You may be able to hook some of those solutions into pydev, I think.
nosklo
2008-10-28 10:21:22
+1
A:
There is a dedicated Pydev Console available by clicking on the "New console" dropdown in the console view.
Dag Høidahl
2009-02-05 15:52:58