2

I was working away on a project in python, and I was wondering how to pront with color. I know of colorama, and termcolor, but they are not working. When I run this code in my python interpreter (PyCharm: https://www.jetbrains.com/pycharm/) the colors work fine, but in the command line, the following:

import colorama
print(colorama.Fore.GREEN + 'Green text')

Outputs as:

[32mGreenText

Between the '[', and the begining of the line, their is a strange character. I know it is not ASCII, and probabaly not Unicode, so I took a screenshot of it. enter image description here -I do not know if that worked, this is my first post-

Thanks in advance

CPSuperstore
  • 633
  • 10
  • 18

1 Answers1

4

Call colorama.init() before print():

import colorama
colorama.init(autoreset=True)
print(colorama.Fore.GREEN + 'Green text')
acw1668
  • 40,144
  • 5
  • 22
  • 34