<p dir="ltr"><br>
On 29 May 2013 12:25, "Avnesh Shakya" <<a href="mailto:avnesh.nitk@gmail.com">avnesh.nitk@gmail.com</a>> wrote:<br>
><br>
> hi,<br>
> I am trying to display my output with different colour on terminal, but it's<br>
> coming with that colour code.<br>
> Please help me how is it possible?<br>
><br>
> my code is -<br>
> from fabric.colors import green, red, blue<br>
> def colorr():<br>
> a = red('This is red')<br>
> b = green('This is green')<br>
> c = blue('This is blue')<br>
> d = {a, b, c}<br>
> print d<br>
> colorr()<br>
><br>
> output -<br>
> set(['\x1b[32mThis is green\x1b[0m', '\x1b[34mThis is blue\x1b[0m', '\x1b[31mThis is red\x1b[0m'])<br>
><br>
> Thanks</p>
<p dir="ltr">You are printing the {a, b, c} set. That ends up printing the repr of all of its contents. The repr breaks the desired output. Try to just</p>
<p dir="ltr">print a, b, c</p>