Styled Output

Daniel Nogradi nogradi at gmail.com
Sat Apr 21 05:56:58 EDT 2007


> > I'm running a program of mine from Linux bash script and it currently
> > outputs status messages to the command prompt, but they all look a little
> > boring to say the least, it'll be like this.
>
> [snip]
>
> > And perhaps have the word 'success' in green, or red for 'failed' and
> things
> > like that, just to make it a little more presentable to the user.

Something like this might also help on linux:


def blue( text ):
    print '\033[1m' + text + '\033[0m'

blue( 'this will be blue' )

See http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html

HTH,
Daniel



More information about the Python-list mailing list