December 16th, 2012, 08:01 AM
Colours in the command prompt!
I need to change the color of one word when I run my program in the command prompt (i.e. run it by double clicking on the .py file)
I searched and found this function. (a little altered for my need)
The thing is, all it can do is change the color of a single line.
windll.Kernel32.GetStdHandle.restype = c_ulong
h = windll.Kernel32.GetStdHandle(c_ulong(0xfffffff5))
But it would only change the color of the line to 2 and to 4 if I removed the changeColor(2) line. So does anyone know any way to change the color of just one word?
print("I will call it "), end="")
Thanks in advance
December 16th, 2012, 02:17 PM
December 17th, 2012, 09:38 AM
Thank you for your reply! I didn't have time to test it before now and got this
Traceback (most recent call last):
File "D:\~ Programming\Python\PYTHON\Test.py", line 4, in <module>
ImportError: No module named 'colorama'
December 17th, 2012, 09:52 AM
I take it you didn't bother to search the internet for colorama, nor did you bother to learn about ANSI terminal control sequences.
[/code] are essential for python code and Makefiles!