How to get Python interactive console in current namespace?
For debug I usually use this
from pdb import set_trace; set_trace()
it may help
Try:
code.interact(local=locals())
Another way is to start the debugger, and then run interact
:
import pdb
pdb.set_trace()
Then from the debugger:
(Pdb) help interact
interact
Start an interactive interpreter whose global namespace
contains all the (global and local) names found in the current scope.
(Pdb) interact
*interactive*
>>>