-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcolors.py
58 lines (43 loc) · 1.09 KB
/
colors.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
import os
'''
COLORS - MODULE - V.1.0
+------------------------+
This is a Python module to print
with colors.
Developed by qq8.
Usage:
colors.printc(text, color)
+------------------------+
'''
os.system('')
def printc(text, color):
"""
Prints text with color.
"""
if color == 'black':
print('\033[30m' + text + '\033[0m')
return
if color == 'red':
print('\033[31m' + text + '\033[0m')
return
if color == 'green':
print('\033[32m' + text + '\033[0m')
return
if color == 'yellow':
print('\033[33m' + text + '\033[0m')
return
if color == 'blue':
print('\033[34m' + text + '\033[0m')
return
if color == 'magenta':
print('\033[35m' + text + '\033[0m')
return
if color == 'cyan':
print('\033[36m' + text + '\033[0m')
return
if color == 'white':
print('\033[37m' + text + '\033[0m')
return
if color == 'underline':
print('\033[4m' + text + '\033[0m')
return