From e91209fd533192cedf009f64b9cc16183b819c82 Mon Sep 17 00:00:00 2001 From: CordlessCoder <42666308+CordlessCoder@users.noreply.github.com> Date: Tue, 5 Jul 2022 19:20:06 +0300 Subject: [PATCH] Update console.py --- utils/console.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/utils/console.py b/utils/console.py index 8a68280..fdab5d5 100644 --- a/utils/console.py +++ b/utils/console.py @@ -4,6 +4,7 @@ from rich.markdown import Markdown from rich.padding import Padding from rich.panel import Panel from rich.text import Text +from rich.columns import Columns import re console = Console() @@ -22,7 +23,14 @@ def print_step(text): panel = Panel(Text(text, justify="left")) console.print(panel) + +def print_table(items): + """Prints items in a table.""" + console.print(Columns([Panel(f"[yellow]{item}", expand=True) for item in items])) + + + def print_substep(text, style=""): """Prints a rich info message without the panelling.""" console.print(text, style=style)