From 45df961f4d488693c1ccb4e1c110987493620597 Mon Sep 17 00:00:00 2001 From: sTiKyt Date: Sun, 10 May 2020 15:57:13 +0300 Subject: [PATCH] Created method to sort any list as menu --- Defs/ActionManager/main_runner.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Defs/ActionManager/main_runner.py b/Defs/ActionManager/main_runner.py index 7b92af4..d5b3381 100644 --- a/Defs/ActionManager/main_runner.py +++ b/Defs/ActionManager/main_runner.py @@ -8,7 +8,10 @@ import os default_palette = theme.default_palette module_loading_message = simple_informant.module_loading_message - +def print_sorted_as_menu(sorting_list): + col_width = max(len(word) for row in sorting_list for word in row) + 2 + for row in sorting_list: + print("".join(word.ljust(col_width) for word in row).format(default_palette[0], default_palette[2])) def start_main_menu():