This is a simple print function overwritten so that you can specify different colors in Terminal outputs.

To use this feature, you'll need to import this customized print function from the ColorPrint package, the GitHub repo is here.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from ColorPrint import print

print('Hello World!') # default printing

print('Hello World!', 'r') # color abbreviation
print('Hello World!', 'c')

print('Hello World!', 'red') # color full names
print('Hello World!', 'cyan')

print('Hello World!', 'rand') # random color
print('Hello World!', 'random')

print('Hello World!', 'discrete_random') # random color for each character
print('Hello World!', 'drand')

and the output is as below (in Terminal):

I find this especially useful when you're trying to focus on command-line workflow only and don't want to build you own wheel over and over again.