"Karim" <karim.liat...@free.fr> wrote
Is there a simple way to print with color to stdout like the
unix/linux
example below:
*print( '^[[1;31mThis is a warning!^[[0m' )
Not generically since stdout is a data stream which may not be
printed (it could be spoken for example - how does the synthesiser
interpret colour?) and the terminal may have a colour scheme that
makes your output invisible!
Also different terminals have different capabilities, many do
not support colour but do support bold/italic/underline etc.
Thats why curses exists, it does a best endeavours attempt
at rendering what you want but reverts to defaults for cases
where it is not supported. but even curses is not able to work
with all terminals - for example line oriented terminals/teletypes.
*I see thing with curses module. But is there an more simple object
in
other module to do the trick?
Kind of _/decorate_output( mode=WARNING, *'This is a warning!')*/_
There are some attempts at providing easier terminal control
functions. The effbot did one I seem to recall....
http://effbot.org/zone/console-handbook.htm
That might suffice for you?
--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor