mirror of
https://github.com/Textualize/rich.git
synced 2025-08-23 03:34:16 +00:00
overflow
This commit is contained in:
parent
f7318cea1b
commit
47bb80ff67
17 changed files with 199 additions and 187 deletions
11
examples/overflow.py
Normal file
11
examples/overflow.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
from typing import List
|
||||
from rich.console import Console, OverflowMethod
|
||||
from rich.text import Text
|
||||
|
||||
console = Console()
|
||||
supercali = "supercalifragilisticexpialidocious"
|
||||
|
||||
overflow_methods: List[OverflowMethod] = ["fold", "crop", "ellipsis"]
|
||||
for overflow in overflow_methods:
|
||||
console.rule(overflow)
|
||||
console.print(supercali, overflow=overflow, width=10)
|
Loading…
Add table
Add a link
Reference in a new issue