0

When i'm using module termcolor for change color of font

from termcolor import colored
print(colored(" THIS APPLICATION IS DEVELOPED BY : ",'yellow'),colored("Mr KATIB Rabah",'red'))
print(" --------------------------------------------------------------------------")

in the command prompt Symbols appear without changing colors The opposite of what Pycharm shows

Microsoft Windows [version 10.0.19041.508]
(c) 2020 Microsoft Corporation. Tous droits réservés.
C:\Users\Katib>cd PycharmProjects\pythonProject

C:\Users\Katib\PycharmProjects\pythonProject>python test6.py
←[33m THIS APPLICATION IS DEVELOPED BY : ←[0m ←[31mMr KATIB Rabah←[0m
 --------------------------------------------------------------------------
  [Pycharm show this with colors][1]

  [1]: https://i.stack.imgur.com/QcOQg.jpg

1 Answers1

0

See this post: How to print colored text in Python?

To get colors working in Windows, you need to run os.system("color") first.

import os
from termcolor import colored

os.system("color")
print(colored(" THIS APPLICATION IS DEVELOPED BY : ",'yellow'),colored("Mr KATIB Rabah",'red'))


Sxribe
  • 819
  • 7
  • 16