rich/examples/just.py

14 lines
349 B
Python

"""
This example demonstrates the justify argument to print.
"""
from rich.console import Console
console = Console(width=20)
style = "bold white on blue"
console.print("Rich", style=style)
console.print("Rich", style=style, justify="left")
console.print("Rich", style=style, justify="center")
console.print("Rich", style=style, justify="right")