dbug runs your script, and wherever it runs into an exception/error, gives you access to the
frames and opens the bpython shell right there, giving you access to the variables.
After fixing your code, you can run reload()
to test again.
bpython: https://github.com/bpython/bpython
python -m dbug <your script>
python -m dbug <your script>:<line number>
select(frame_no)
: Selects a frame given a frame number and opens the shell inside
reload()
: reload the original script