John Posner wrote:
On Tue, 05 Jan 2010 15:08:04 -0500, Dave McCormick
<mackrac...@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
--
http://mail.python.org/mailman/listinfo/python-list