From ce8ea0709a214b8c912ebd1bd7cea91173bd499d Mon Sep 17 00:00:00 2001 From: novuh Date: Thu, 12 Aug 2021 15:52:43 -0400 Subject: [PATCH] Add files via upload --- src/utils/console.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/utils/console.py diff --git a/src/utils/console.py b/src/utils/console.py new file mode 100644 index 0000000..1f8a615 --- /dev/null +++ b/src/utils/console.py @@ -0,0 +1,25 @@ +import os +import ctypes + +from colorama import Fore, Style +from datetime import datetime + +def time_tag() -> str: + time = datetime.now().strftime("%H:%M") + tt = Style.BRIGHT + Fore.BLACK + f" [{time}] " + return tt + +class tags: + default = time_tag() + f"{Fore.WHITE}[ {Fore.YELLOW}anti {Fore.WHITE}] " + error = time_tag() + f"{Fore.WHITE}[ {Fore.RED}ERR! {Fore.WHITE}] " + okay = time_tag() + f"{Fore.WHITE}[ {Fore.GREEN}OKAY {Fore.WHITE}] " + +def clear(): + """Clears console/terminal""" + if "nt" in os.name: + os.system("cls") + else: + os.system("clear") + +def title(t: str): + ctypes.windll.kernel32.SetConsoleTitleW(t)