From 17fcf43ee5023f3122b5b9414c3ca6a855ba757c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Ho=CC=88nicke?= Date: Thu, 20 Apr 2023 10:34:52 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9C=20fix:=20encoding=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/string_tools.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/utils/string_tools.py b/src/utils/string_tools.py index 6b6e562..bd8c420 100644 --- a/src/utils/string_tools.py +++ b/src/utils/string_tools.py @@ -1,8 +1,5 @@ -import os import platform -if platform.system() == "Windows": - os.system("color") def print_colored(headline, text, color_code, end='\n'): if color_code == 'black': @@ -24,6 +21,10 @@ def print_colored(headline, text, color_code, end='\n'): color_start = f"\033[{color_code}m" reset = "\033[0m" bold_start = "\033[1m" + if platform.system() == "Windows": + color_start = "" + reset = "" + bold_start = "" if headline: print(f"{bold_start}{color_start}{headline}{reset}") print(f"{color_start}{text}{reset}", end=end)