
Stay up to date – embedded code automagically updates, each snippet and article has a feed
Join Siafoo Now
or
Learn More
Python colored output
3
In Brief | A quick list of color formatting for python output. It helps make large amount of debug / info print statements more readable... more |
Language | Python |
# 's
1print '\033[1;30mGray like Ghost\033[1;m'
2print '\033[1;31mRed like Radish\033[1;m'
3print '\033[1;32mGreen like Grass\033[1;m'
4print '\033[1;33mYellow like Yolk\033[1;m'
5print '\033[1;34mBlue like Blood\033[1;m'
6print '\033[1;35mMagenta like Mimosa\033[1;m'
7print '\033[1;36mCyan like Caribbean\033[1;m'
8print '\033[1;37mWhite like Whipped Cream\033[1;m'
9print '\033[1;38mCrimson like Chianti\033[1;m'
10print '\033[1;41mHighlighted Red like Radish\033[1;m'
11print '\033[1;42mHighlighted Green like Grass\033[1;m'
12print '\033[1;43mHighlighted Brown like Bear\033[1;m'
13print '\033[1;44mHighlighted Blue like Blood\033[1;m'
14print '\033[1;45mHighlighted Magenta like Mimosa\033[1;m'
15print '\033[1;46mHighlighted Cyan like Caribbean\033[1;m'
16print '\033[1;47mHighlighted Gray like Ghost\033[1;m'
17print '\033[1;48mHighlighted Crimson like Chianti\033[1;m'
Comments
why is it soo..?
As in the following echo statement...
echo '\033[1;33mFoo\033[1;m'
if so use -e to enable interpretation of escaped characters
result:
echo -e '\033[1;33mFoo\033[1;m'