On this page
article
Tip #117: Use logging not print in production code
Python tip #117: Use logging not print in production code.
Tip
Use logging not print in production code
Why
Following this practice makes your Python code more readable, maintainable, and less error-prone.
Example
# Before (avoid)
# ... less idiomatic approach ...
# After (prefer)
# ... idiomatic Python 3.10+ approach ...