I would like to add in my PYTHON script some colored caracters. For example, errors messages will be in red. I installed colorama and colorlist modules but when i print there is no colored caracters.
from colorist import red
red("Hello World")
or
from colorama import Fore, Back, Style
print(Fore.RED + 'some red text'
Neither your code, nor the python.exe process, is actually responsible for displaying the text - that’s done by the terminal. So the only thing your program can do is change what data it outputs, and the terminal can interpret that data as a command to change the colour - if it supports that. The purpose of packages like colorama is to make it easier to send those commands, but Python has no way to either know or control whether the commands are actually understood or obeyed. (This is the same issue for command-line programs in every programming language.)
To fix this, we need to understand what terminal you are using. It may be possible to change some settings, but you may need to use a different terminal completely.
If you need absolute control (i.e. the program has to make sure of what the output looks like, and cannot depend on the terminal), your only real option is to make a GUI program instead (you can even go so far as to make the GUI implement a terminal). This is, of course, much more complex.
Oh, right, thanks for the reminder. Colorama has something for this. Since 0.4.6, colorama.just_fix_windows_console() should make those calls. There’s also a colorama.init() which… does more things. See the documentation on GitHub for details.