It is a method to use the debugger of Ipyhoon.core which is stronger than pdb.
set_debugger.py
import sys
def set_debugger_org():
if not sys.excepthook == sys.__excepthook__:
from IPython.core import ultratb
sys.excepthook = ultratb.FormattedTB(call_pdb=True)
def set_debugger_org_frc():
from IPython.core import ultratb
sys.excepthook = ultratb.FormattedTB(call_pdb=True)
def set_trace():
from IPython.core.debugger import Pdb
Pdb(color_scheme='Linux').set_trace(sys._getframe().f_back)
You can call `set_debugger_org_frc ()`
etc. in the main function.
Unfortunately, there are times when it doesn't get into the debugger well.
I was taught by my senior. Thank you.
Recommended Posts