text output with color
Fellow programmers, 
I am running a Monte Carlo type simulation in python that generates long strings of 0,1, and 2's and I'm trying to output them in a text or html file for further analysis. 

I'd like to print these strings in an external file, and use different colors for the different digits. 
Say, 0 = red, 1 = green, and 2 = two. 

My knowledge of Python, and html is somehow limited. Any "pointers"(sorry for unintentional pun) and sample bits of code will be very welcome. 
text output with color
===

Fellow programmers, 
I am running a Monte Carlo type simulation in python that generates long strings of 0,1, and 2's and I'm trying to output them in a text or html file for further analysis. 

I'd like to print these strings in an external file, and use different colors for the different digits. 
Say, 0 = red, 1 = green, and 2 = two. 

My knowledge of Python, and html is somehow limited. Any "pointers"(sorry for unintentional pun) and sample bits of code will be very welcome. 