I’m aware that this is possible with the os module’s os.system(“color”) function, but this changes the whole terminal what I’m looking for something localized to only a single string or variable output. Something in the standard library would be optimal as I want to use this on multiple computers without have to use py2exe or freeze.
I’m aware that this is possible with the os module’s os.system(color) function, but this
Share
Please take a look at the answer for the question:
If you can’t install addtional modules, you can try to use
ANSI-sequences directly. Please note, that the method is not portable,
and it’s better to use some special module.
When you need somthing more powerful, I suggest you using
colorama(pypi.python.org/pypi/colorama):Another option, use
termcolor: