Dynamic text color

Dave McCormick mackrackit at gmail.com
Tue Jan 5 16:54:44 EST 2010



John Posner wrote:
> On Tue, 05 Jan 2010 15:08:04 -0500, Dave McCormick 
> <mackrackit at gmail.com> wrote:
>
> It sounds like the program is doing exactly what you TOLD it to do 
> (which might not be what you WANT it to do):
>
>  1. In an earlier pass on the text, color the string "dog" red.
>  2. In a later pass, color the string "do" green.
>
> You need to decide what you WANT to happen if one word to be colored 
> is a substring of another word to be colored differently. Or maybe you 
> want to outlaw such situations. After making that decision, you can 
> start to think about how to write the appropriate code.
>
> Best,
> John
Darn thing doing what I told it to do...  Guess that means I did 
something right :)
But it is not what I am wanting. 
I first thought to make it look for a space but that would not work when 
a single character like "#" is to be colored if there is a "string" of 
them.  Or if all of the characters between quotes are to be colored. 

I always did like puzzles!

Dave



More information about the Python-list mailing list