1001 Python Programming Tips

Introduction to 1001 Python Tips & Tricks

On this page I capture all the little Python tips & tricks which I discover while working with Python. They tend to be the little snippets which are too small for a full blog post.

Don’t use Print for debugging

There is a good alternative to using Print in the Python Ice cream Library – see this great article https://towardsdatascience.com/stop-using-print-to-debug-in-python-use-icecream-instead-79e17b963fcc for a full introduction.

For me, one of the key benefits is, it makes the intent clear. When you’ve finished debugging there is no doubt about what was temporary debug code and what should be kept. It’s much easier to search through for ‘ic’ and remove all those lines than it is for ‘print’.