/
githubmirror
/
rich
Обзор
Документация
Войти
/
githubmirror
/
rich
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
tools/stress_test_pretty.py
21 строка
565 B
Will McGugan
optimizations
25 ноя 2021, 23:47
25 ноя 2021, 23:47
55e1190
Код
Авторство
О чём код?
from rich.console import Console from rich.panel import Panel from rich.pretty import Pretty from rich._timer import timer DATA = { "foo": [1, 2, 3, (), {}, (1, 2, 3), {4, 5, 6, (7, 8, 9)}, "Hello, World"], "bar": [None, (False, True)] * 2, "Dune": { "names": { "Paul Atreides", "Vladimir Harkonnen", "Thufir Hawat", "Duncan Idaho", } }, } console = Console() with timer("Stress test"): for w in range(130): console.print(Panel(Pretty(DATA, indent_guides=True), width=w))