Calmcode - rich: introduction

Pretty terminal output with Python and Rich.

1 2 3 4 5 6 7 8 9 10 11 12

Print statements are nice but you can make them (literally) richer than just plain text. The rich package helps you do just that.

You will need to install the tool before you can use it.

python -m pip install rich

Here's the code used in this video.

from rich import print

print(f"I wonder what this looks like 1 + 1 = {1 + 1}")
print({"a": [1, 2, 3], "b" : {"c" : 1}})

You can make python print rich text using the rich package, but we'll see many more examples of what it can do for you.