From 480c13de130d90b8cd45c4bd6a7edb175464cde9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=A5=D1=80?= =?UTF-8?q?=D0=B0=D0=BC=D0=BE=D0=B2?= Date: Wed, 15 May 2024 18:05:35 +0300 Subject: [PATCH] =?UTF-8?q?print=5Fline=20=D0=BF=D0=BE=20=D0=B4=D0=BB?= =?UTF-8?q?=D0=B8=D0=BD=D0=B5=20=D0=BA=D0=BE=D0=BD=D1=82=D0=B5=D0=BD=D1=82?= =?UTF-8?q?=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hlna.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/hlna.py b/hlna.py index 3f01062..f26f28c 100755 --- a/hlna.py +++ b/hlna.py @@ -161,10 +161,17 @@ def print_line(*text, flag="", sep=" ", end="\n"): len_text = str(*text) len_text = len_text.split("\n") - max_length = max(len(str(string)) for string in len_text) + 2 - print(color + "." * max_length) + max_string = max(len(str(string)) for string in len_text) + 2 + max_length = shutil.get_terminal_size() + max_length = max_length[0] + if max_string > max_length: + len_dots = max_length + else: + len_dots = max_string + + print(color + "." * len_dots) print(color, *text, sep=sep, end=end) - print(color + "." * max_length + colorama.Style.RESET_ALL) + print(color + "." * len_dots + colorama.Style.RESET_ALL) def zmeyuka(stdscr, func):