Python Tip #169 (of 365):
Use PDB's post-mortem mode to debug exceptions
Python script raising an exception and want to drop into an interactive environment RIGHT after the exception occurs?
Use "python -m pdb your_script.py"
Using "-m" runs the pdb module as a script.
When launched like this, PDB enters "post-mortem debugging" mode.
You'll drop into PDB as soon as your program launches.
🧵 (1/3)






