error/warning color customization in interactive console?

Ian Clark iclark at
Wed Jan 16 17:12:42 CET 2008

On 2008-01-16, yhvh <yhvh2000 at> wrote:
> Is it possible to output error messages in a different color?
> I'm using Terminal on Gnome.

>>> print "\033[1;31mHello\033[0m There!"

Some reading:

Also, you might look at sys.excepthook to colorize an uncaught exception,
and PYTHONSTARTUP to load code automagically before an interactive


More information about the Python-list mailing list