Is there any way to change shell print color in python 3.3.2 in Linux and Windows shell? I\'ve read all other topics but none of them working with this version or I should i
These will work on Linux and Mac, but not Windows. I reference them whenever I need to colorize my output.
The first shows how to change the color.
# snippet found at http://stackoverflow.com/questions/287871/print-in-terminal-with-colors-using-python
class bcolors:
WARNING = '\033[95m'
ENDC = '\033[0m'
print(bcolors.WARNING + "Warning: No active frommets remain. Continue?" + bcolors.ENDC)
The second shows how each value displays in your environment.
for i in range(0, 128):
print("\033[%imThis is text!!\t\t( \\033[%im )\033[0m" % (i, i))