mirror of
https://github.com/Textualize/rich.git
synced 2025-07-07 21:04:58 +00:00
15 lines
426 B
Python
15 lines
426 B
Python
"""
|
|
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")
|