rich/tools/stress_test_pretty.py

20 lines
500 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 = {
2020-08-24 16:26:30 +00:00
"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-10-20 14:03:28 +00:00
"Dune": {
"names": {
2021-02-20 16:39:23 +00:00
"Paul Atreides",
2020-10-20 14:03:28 +00:00
"Vladimir Harkonnen",
2021-02-20 16:39:23 +00:00
"Thufir Hawat",
2020-10-20 14:03:28 +00:00
"Duncan Idaho",
}
},
2020-08-08 17:51:34 +00:00
}
console = Console()
2020-08-10 15:37:46 +00:00
for w in range(130):
2020-10-22 20:17:03 +00:00
console.print(Panel(Pretty(DATA, indent_guides=True), width=w))