Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #46366

Output is not coming with defined color

Newsgroups comp.lang.python
Date 2013-05-29 04:14 -0700
Message-ID <0965b949-8bf4-4105-aa8a-17cfd0d22aa4@googlegroups.com> (permalink)
Subject Output is not coming with defined color
From Avnesh Shakya <avnesh.nitk@gmail.com>

Show all headers | View raw


hi,
   I am trying to display my output with different colour on terminal, but it's
coming with that colour code.
Please help me how is it possible?

my code is - 
from fabric.colors import green, red, blue
def colorr():
    a = red('This is red')
    b = green('This is green')
    c = blue('This is blue')
    d = {a, b, c}
    print d
colorr()

output - 
set(['\x1b[32mThis is green\x1b[0m', '\x1b[34mThis is blue\x1b[0m', '\x1b[31mThis is red\x1b[0m'])

Thanks

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Output is not coming with defined color Avnesh Shakya <avnesh.nitk@gmail.com> - 2013-05-29 04:14 -0700
  Re: Output is not coming with defined color Fábio Santos <fabiosantosart@gmail.com> - 2013-05-29 13:11 +0100
    Re: Output is not coming with defined color rusi <rustompmody@gmail.com> - 2013-05-29 07:09 -0700

csiph-web