Is it possible to print out things in different colors in Python for Windows? I already enabled ANSI.sys, but this does not seam to work.
I want to be able to print one line in red, and the next in green, etc.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The WConio module should be all you need to accomplish this.
The constants it refers to are not actually listed on the page, but are at the top of the WConio.py file:
So a full call to set the text foreground colour to red would be: