Re: Dynamic text color

2010-01-08 Thread Dave McCormick
John Posner wrote: On Fri, 08 Jan 2010 14:28:57 -0500, MRAB wrote: The regex r'\bgreenList_regexp\b' will match the string 'greenList_regexp' if it's a whole word. What you mean is "any of these words, provided that they're whole words". You'll need to group the alternatives within "(?:...

Re: Dynamic text color

2010-01-08 Thread Dave McCormick
On Fri, Jan 8, 2010 at 12:28 PM, MRAB wrote: > Dave McCormick wrote: > >> >> >> On Wed, Jan 6, 2010 at 9:18 AM, John Posner > jjpos...@optimum.net>> wrote: >> >>On Tue, 05 Jan 2010 16:54:44 -0500, Dave McCormick >>mailto:mackrac...@gmai

Re: Dynamic text color

2010-01-08 Thread Dave McCormick
On Wed, Jan 6, 2010 at 9:18 AM, John Posner wrote: > On Tue, 05 Jan 2010 16:54:44 -0500, Dave McCormick > wrote: > > 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

Re: Exception as the primary error handling mechanism?

2010-01-07 Thread Dave McCormick
Lie Ryan wrote: That's a sign of a gotcha... a well-designed language makes you think about your problem at hand and less about the language's syntax. Not until you learn the language that is. From a Python newbee ;-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Dynamic text color

2010-01-05 Thread Dave McCormick
John Posner wrote: On Tue, 05 Jan 2010 15:08:04 -0500, Dave McCormick 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,

Re: Dynamic text color

2010-01-05 Thread Dave McCormick
John Posner wrote: Dave, you're doing exactly the right thing: gradually expanding your program, to provide more functionality and to learn more about the available programming tools. It's also very good that you take care to close() the file after processing it. Now for the bad news ... S

Re: Fwd: I would like to install Python on my 64 bit Win 7

2010-01-05 Thread Dave McCormick
aung paing Soe wrote: -- Forwarded message -- From: aung paing Soe Date: Tue, Jan 5, 2010 at 11:27 AM Subject: I would like to install Python on my 64 bit Win 7 To: webmas...@python.org Hello ,   I would like to study about Python Pr

Re: Dynamic text color

2010-01-05 Thread Dave McCormick
John Posner wrote: On Fri, 01 Jan 2010 21:01:04 -0500, Cousin Stanley wrote: I was not familiar with the re.finditer method for searching strings ... Stanley and Dave -- So far, we've just been using finditer() to perform standard-string searches (e.g. on the word "red"). Sinc

Re: Dynamic text color

2010-01-03 Thread Dave McCormick
John Posner wrote: On Sat, Jan 2, 2010 at 1:47 PM, Dave McCormick wrote: WooHoo!!! I got it!!! Yup, I am sure it can be optimized but it works!!! Dave, please ignore a couple of my bogus complaints in the previous message: ... you call function new_Rword() before you define it ... th

Re: Dynamic text color

2010-01-02 Thread Dave McCormick
uot;green") root = Tk() Tbox = Text(root, width=40, height=15, wrap=CHAR, font="Times 14 bold", bg="#dd") Tbox.pack() Tbox.bind("", get_position) Tbox.focus() root.mainloop() John Posner wrote: On Thu, 31 Dec 2009 10:24:44 -0500, Dave McCorm

Re: Dynamic text color

2009-12-31 Thread Dave McCormick
hu, 31 Dec 2009 10:24:44 -0500, Dave McCormick wrote: John, Thank you for the tips. I was changing the line-column index to a FLOAT because the search would return the starting position (pos) of the string, then by making it a FLOAT and adding the string length I was able to get the end pos

Re: Dynamic text color

2009-12-31 Thread Dave McCormick
the documentation I can find about "text.tag_add()" uses line-column for coordinates. If I count characters from the beginning how do I know what line the text is on? Would you mind making your last hint a bit stronger... Thanks again! Dave John Posner wrote: On Wed, 30 Dec 2

Dynamic text color

2009-12-30 Thread Dave McCormick
Hi All, I am new to Python and the list so I hope I am posting this correctly... I am working on a way to have text automatically formated in a Tkiniter Text widget and would like some input on my code. Currently I am using Python 2.5 because the server I use has that installed. Tkinter is tk