print_line по длине контента

This commit is contained in:
2024-05-15 18:05:35 +03:00
parent c1af88e361
commit 480c13de13

13
hlna.py
View File

@ -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):