rich/tools/stress_test_pretty.py

12 lines
303 B
Python
Raw Normal View History

2020-08-08 17:51:34 +00:00
from rich.console import Console
2020-08-10 15:37:46 +00:00
from rich.panel import Panel
2020-08-08 17:51:34 +00:00
from rich.pretty import Pretty
DATA = {
"foo": [1, 2, 3, (1, 2, 3), {4, 5, 6, (7, 8, 9)}, "Hello, World"],
2020-08-10 15:37:46 +00:00
"bar": [None, (False, True)] * 2,
2020-08-08 17:51:34 +00:00
}
console = Console()
2020-08-10 15:37:46 +00:00
for w in range(130):
console.print(Panel(Pretty(DATA), width=w))