0

I am trying to print a text in a different color. I have already installed termcolor, but when type:

from termcolor import colored
print(colored("hello","blue"))

it appears

[34mhello[0m .
Trenton McKinney
  • 56,955
  • 33
  • 144
  • 158
Gon
  • 123
  • 5

1 Answers1

0

First of all: pip install colorama
And seconds:

from colorama import Fore, Back, Style
print(Fore.GREEN + Back.RED + Style.DIM + "hello world")

(This is an example, whole pip package usage * description click here)
For some unknown reason for me when I open CMD & try it doesn't work BUT when I code in VSCode & run from there with terminal window as CMD it works fine.

barakadax
  • 47
  • 9