-
Notifications
You must be signed in to change notification settings - Fork 1
/
outputs.py
64 lines (43 loc) · 1.57 KB
/
outputs.py
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
from colorama import init, Fore, Back, Style
init()
def normal_info(*args, **kwargs):
print(*args, **kwargs)
def bold_info(*args, **kwargs):
print(Style.BRIGHT, end='')
print(*args, **kwargs)
print(Style.RESET_ALL, end='')
def success_info(*args, **kwargs):
print(Fore.GREEN, end='')
print(*args, **kwargs)
print(Fore.RESET, end='')
def error_info(*args, **kwargs):
print(Fore.RED, end='')
print(*args, **kwargs)
print(Fore.RESET, end='')
def warning_info(*args, **kwargs):
print(Fore.YELLOW, end='')
print(*args, **kwargs)
print(Fore.RESET, end='')
def error_tag(*args, end='\n', **kwargs):
print(Back.RED + Fore.BLACK, end='')
print(*args, **kwargs, end='')
print(Back.RESET + Fore.RESET, end=end)
def warning_tag(*args, end='\n', **kwargs):
print(Back.YELLOW + Fore.BLACK, end='')
print(*args, **kwargs, end='')
print(Back.RESET + Fore.RESET, end=end)
def success_tag(*args, end='\n', **kwargs):
print(Back.GREEN + Fore.BLACK, end='')
print(*args, **kwargs, end='')
print(Back.RESET + Fore.RESET, end=end)
def normal_tag(*args, end='\n', **kwargs):
print(Back.WHITE + Fore.BLACK, end='')
print(*args, **kwargs, end='')
print(Back.RESET + Fore.RESET, end=end)
def prompt_val(prompt='', val='', output='normal', sep=": ", reverse=False, end='\n'):
if reverse:
globals()[f'{output}_tag'](val, end='')
globals()[f'{output}_info'](sep+prompt, end=end)
else:
globals()[f'{output}_info'](prompt+sep, end='')
globals()[f'{output}_tag'](val, end=end)