I want my Python script to have an option to color its output, so I decided to try ANSI escape codes:
print '\e[1;31mColor Text\e[0m'
print '\u001b[1;31mColor Text\u001b[0m'
But instead of coloring the text, the escape codes got printed out literally:
I thought that '\e' is the standard code for escape, and I read that '\uXXXX' is a hex unicode character in Python, but none worked.
I know that the escape codes work because I even have my bash prompt colored with them, but it seems like I just can't get Python to output an escape character.
What should I do?