How can I output colored text to the terminal in Python?
If you are using Django
>>> from django.utils.termcolors import colorize
>>> print colorize("Hello World!", fg="blue", bg='red',
... opts=('bold', 'blink', 'underscore',))
Hello World!
>>> help(colorize)
snapshot:
(I generally use colored output for debugging on runserver terminal so I added it.)
You can test if it is installed in your machine:
$ python -c "import django; print django.VERSION"
To install it check: How to install Django
Give it a Try!!