0

from termcolor import colored, cprint

cprint("TESTING TERMCOLOR", "red")

This code is working in my IDE (Pycharm) but not on my terminal. Gives coloured output in IDE but not in terminal. This is the Output in terminal:

[31mTESTING TERMCOLOR[0m

  • Please add what os you are using. If you are using Windows 7, the CMD doesnt support ANSI control codes. Other package like `colorama` has a way to convert ANSI code to Windows native DLL call, so the color will show up. – dragon2fly Jan 26 '20 at 12:09

1 Answers1

0

If by cmd you mean the standard windows terminal, I fear termcolor does not work out of the box there. See e.g. Why does termcolor not work in python27 windows? or Why does termcolor output control characters instead of colored text in the Windows console?. https://github.com/tartley/colorama seems to be a workaround to make it work there

Michael H.
  • 3,323
  • 2
  • 23
  • 31