[Python] Super useful debugging

For those who want to debug easily with python

When running python on the command line

$ python hoge.py -m pdb

If you add "-m pdb" like this, it will be executed in debug mode. (I recently learned that this alone is very convenient)

When you want to stop processing at any place ...

When you want to set a breakpoint like Eclipse,

to hoge.py

python


assert False

Just insert and run in debug mode.

It responds to assert False and stops there, so you can do whatever you want.

It ’s short, but that ’s it!

Recommended Posts

[Python] Super useful debugging
Python debugging tips
[Python] Class inheritance (super)
python useful memo links
python memorandum super basic
[Python] Debugging is more efficient!
python super beginner tries scraping
Debugging with pdb in Python
Useful when debugging with TouchDesigner
Super tiny struct in python
[python] super (), inheritance, __init__, etc.
Python #function 2 for super beginners
Python for super beginners Python #functions 1
Python #list for super beginners
Python | Jupyter> Post-mortem debugging | pdb.post_mortem ()
Full understanding of Python debugging
[Python tricks] 5 minor but useful Python tricks
Try to display various information useful for debugging with python
Python
Python for super beginners Python # dictionary type 1 for super beginners
Python #index for super beginners, slices
Python #len function for super beginners
Useful to remember! 10 Python Standard Libraries
[Python] Reasons for overriding using super ()
Python #Hello World for super beginners
Python for super beginners Python # dictionary type 2 for super beginners
[Python] Super easy test with assert statement
A super introduction to Python bit operations
Python 3.9 dict merge (`|`) seems to be useful
6 Python libraries for faster development and debugging
Let's put together Python for super beginners
[Python] Script useful for Excel / csv processing
Summary of useful techniques for Python Scrapy