I have a strange problem that I cannot rely on. There is a program that I use (and from time to time contributing) that has colored console output. Everything worked fine until I reinstalled Windows. Now I can not get the color output.
This is a script that is used for coloring.
I managed to narrow the problem down to a more or less simple situation, but I have no idea what is wrong.
This is a console prompt that works as expected (the string test is printed in red):
Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path.insert(0, r'c:\bin\SV\tea\src') >>> from tea.console.color import cprint, Color >>> cprint('test\n', Color.red) test >>>
But when I run the following script with the same version of python, I get the test output, but not in red (no color, only the default console color):
import sys sys.path.insert(0, r'c:\bin\SV\tea\src') from tea.console.color import cprint, Color cprint('test\n', Color.red)
- The same setup worked before I reinstalled my system.
- I checked the environment variables in interactive mode and the script are the same.
- I tried this on the standard Windows command prompt and console, a program that I usually use.
- The OS in question is Windows 8, and it was also used in Windows 8 before reinstalling.
- The same code with the same settings works on the computer at work (Windows 7).
- I have Python 2.7 and Python 3.3 installed (as before). I tried to run the script with a direct call to the python interpreter (
c:\Python27\python.exe ) or using py -2 , but this does not help. - IPython and mercurial paint the output properly.
Any ideas what I can try to make this work?
Edit
It may not have been clear, but the script I use for output is the data output in the corresponding link. Here again: https://bitbucket.org/alefnula/tea/src/dc14009a19d66f92463549332a321b29c71d47b8/src/tea/console/color.py?at=default
source share