-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutil.py
More file actions
25 lines (19 loc) · 765 Bytes
/
Copy pathutil.py
File metadata and controls
25 lines (19 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from datetime import datetime
from colorama import Fore, Back, Style, init
import os
def LogInfo(text:str):
dt = datetime.now()
print(f"[{dt.hour}:{dt.minute}:{dt.second}] {Fore.BLUE}INFO{Style.RESET_ALL}: {text}")
def LogWarning(text:str):
dt = datetime.now()
print(f"[{dt.hour}:{dt.minute}:{dt.second}] {Fore.YELLOW}WARNING{Style.RESET_ALL}: {text}")
def LogError(text:str):
dt = datetime.now()
print(f"[{dt.hour}:{dt.minute}:{dt.second}] {Fore.RED}ERROR{Style.RESET_ALL}: {text}")
def Take(target_list:list, count:int):
return target_list[:count]
def TakeLast(target_list:list, count:int):
return target_list[-count:]
def ClearConsole():
if os.name == "nt": os.system("cls")
if os.name == "posix": os.system("clear")