[Tkinter-discuss] How can I edit a string inside a textbox?

Mick O'Donnell michael.odonnell at uam.es
Tue Dec 11 13:48:57 CET 2007

From: Alex Garipidis
> thanks again for your answer :). Unfortunately I get the same error
> message with the "+1c"... "Bad text > index +1c". 

Alex, the following coder works for me under Python 2.5 under Windows XP:

from  Tkinter import *
root = Tk()
tw = Text(root)
tw.insert(END, "The @cat sat on the mat.")
pos=tw.search("@", "1.0")
end = tw.search("\W", pos + "+1c", regexp=True)
print pos, end

If it fails on your setup, what version of Python do you have? What


View this message in context: http://www.nabble.com/How-can-I-edit-a-string-inside-a-textbox--tp14271911p14273355.html
Sent from the Python - tkinter-discuss mailing list archive at Nabble.com.

More information about the Tkinter-discuss mailing list