File size: 426 Bytes
dae14ad | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | """
This example demonstrates the justify argument to print.
"""
from rich.console import Console
from rich.panel import Panel
console = Console(width=20)
style = "bold white on blue"
panel = Panel("Rich", style="on red", expand=False)
console.print(panel, style=style)
console.print(panel, style=style, justify="left")
console.print(panel, style=style, justify="center")
console.print(panel, style=style, justify="right")
|