Member-only story
Python: Libraries you should use — Part-2
Hi, Welcome to the next installment of my exploration into Python’s vast library ecosystem! In this segment, I will continue uncovering some of the coolest Python libraries that I think can enhance your projects and simply your development process.
Let’s dive in —
1. Icecream
This library helps debugging easier. And the really nice about this is that you can use print()
or log()
to debug. It prints expressions and their values, making it 60% faster to type. Data structures are neatly formatted, and the output is syntax-highlighted.
Example —
from icecream import ic
def foo(i):
return i + 333
print(foo(123)) # 456
ic(foo(123)) # ic| foo(123): 456
So in the above example, ic
not only going to print the result but also going to print the function and the arguments that were passed to the function. So, yes this is incredibly useful for debugging as you will save lots of time printing variables.
2. rich
Rich
is a Python library for enhancing terminal output with rich text and beautiful formatting.
Example —
from rich.console import Console
from…