rich/examples/justify.py

14 lines
349 B
Python
Raw Permalink Normal View History

2020-06-01 15:08:06 +00:00
"""
This example demonstrates the justify argument to print.
"""
2020-05-17 13:52:48 +00:00
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")