... rich.

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


Here's the code used in this video.

import time
from rich.console import Console
from rich.traceback import install 

def add_two(n1, n2):
    console.log("About to add two numbers.", log_locals=True)
    return n1 + n2

console = Console()
for i in range(10):
    add_two(1, i)
add_two(1, 'a')

Feedback? See an issue? Something unclear? Feel free to mention it here.

If you want to be kept up to date, consider getting the newsletter.