IceCream: Never use print() to debug again
![](https://www.deeplearningdaily.com/wp-content/uploads/2021/09/icecream-never-use-print-to-debug-again_612ffa99082da-375x210.jpeg)
IceCream — Never use print() to debug again
Do you ever use print()
or log()
to debug your code? Of course you do. IceCream, or ic
for short, makes print debugging a little sweeter.
IceCream is well tested, permissively licensed, and supports Python 2, Python 3, PyPy2, and PyPy3.
Inspect Variables
Have you ever printed variables or expressions to debug your program? If you’ve ever typed something like
or the more thorough
print("foo('123')", foo('123'))
then ic()
is here to help. With arguments, ic()
inspects itself and prints both its own arguments and the values of those arguments.
from icecream import ic