-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathoutput.py
33 lines (31 loc) · 1000 Bytes
/
output.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
class bcolors:
PLAIN = '\033[97m'
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKCYAN = '\033[96m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
def print_header(data, quiet):
if quiet:
return
tabs = "="
spacing = " "
num = 40 - (len(data) + 2)
leftt = int((num - (num%2))/2)
right = int((num + (num%2))/2)
print(bcolors.BOLD + tabs*leftt + spacing + data + spacing + tabs*right + bcolors.ENDC)
if __name__ == "__main__":
print(bcolors.HEADER, "Testing colors")
print(bcolors.PLAIN, "This is PLAIN")
print(bcolors.OKBLUE, "This is OKBLUE")
print(bcolors.OKCYAN, "This is OKCYAN")
print(bcolors.OKGREEN, "This is OKGREEN")
print(bcolors.WARNING, "This is WARNING")
print(bcolors.FAIL, "This is FAIL")
print(bcolors.ENDC, "This is ENDC")
print(bcolors.BOLD, "This is BOLD")
print(bcolors.UNDERLINE, "This is UNDERLINE")