[Tutor] Re: Tutor digest, Vol 1 #1707 - 7 msgs
Chad Crabtree
flaxeater@yahoo.com
Fri, 21 Jun 2002 13:27:19 -0700 (PDT)
Hey I'm wrote a few days ago about how to interogate
A TKinter text box so that I could delete the last
line
I got a response that worked however I figured out a
slight improvement that might be usefull.
The exampe I got was
def delete(self):
l =
len(self.textArea.get(1.0,10000.0).split('\n'))
self.textArea.delete(float(l-1),float(l))
the person said that he/she (can't remember) couldn't
think of any way other than to go really deep on the
get
however It just occured to me that
def delete(self):
l =
len(self.textArea.get(1.0,END).split('\n'))
self.textArea.delete(float(l-1),float(l))
one could use the END on the second index to give
proper results. The previous example was very helpful
as I would not have been able to figure out how to get
the number of indexes.
__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com