-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbrpint.py
More file actions
32 lines (23 loc) · 783 Bytes
/
brpint.py
File metadata and controls
32 lines (23 loc) · 783 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
26
27
28
29
30
31
32
# bprint stays for Background Print
# it just prints a text with a different background color, useful to
# (a) keep track of what happens during code execution
# (b) make the output a little more cute :3
def bprint_yellow(text : str):
print(f"\033[0;30;43m{text}\033[0m")
def bprint_blue(text : str):
print(f"\033[0;30;44m{text}\033[0m")
def bprint_red(text : str):
print(f"\033[0;30;41m{text}\033[0m")
def bprint_green(text : str):
print(f"\033[0;30;42m{text}\033[0m")
# examples
# common messages
bprint_blue(f'Loaded data')
bprint_blue(f'Starting training of the model...')
# success
exec_time = 709
bprint_green(f'\nCompleted in {exec_time}ms')
# errors
bprint_red(f'\nError during evaluation')
# warning or similar
bprint_yellow(f'\n(Your model sucks)')