> On Nov 15, 2018, at 07:18, John Blower <johnblower2...@outlook.com> wrote:
> 
> I try to create colour text by using these two  modules , only returns the 
> colour code, no colour text.
> How to solve this problem.
> 
>>>> import termcolor
>>>> import colorama
>>>> colorama.init()
>>>> termcolor.cprint('Hello World','red')
> [31mHello World[0m

I don’t know what those modules are, but based on the output, where you use 
them will matter.
Those are the correct ESC codes to print something in red, but your terminal 
needs to support displaying the colors.

If you are trying this in the python interpreter, try making a basic test 
script and run it instead to see if it works outside the interpreter 
environment.

I assume you are on Windows, too.  What OS and what version of Python are you 
using?

— 
David Rock
da...@graniteweb.com




_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to