开发者

How do I print / puts with color?

Like in the cucumber tests, there are color-coded outputs... how do开发者_如何学Go I do that?


Do you mean in the context of irb? If so, I'd suggest Wirble to colourize your output.


I'm not sure this is from any gem I have, but doing thig will result in purple output.

puts "\e[0;35m this is a purple text \e[0m\n"


puts "\e[0;31m your text here \e[0m\n"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜