File: justify2.py

package info (click to toggle)
rich 13.9.4-1.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 20,284 kB
  • sloc: python: 29,157; makefile: 29
file content (15 lines) | stat: -rw-r--r-- 426 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
"""
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")