get() in Tkinter

Matthew Dixon Cowles matt at mondoinfo.com
Sat Aug 31 13:40:58 EDT 2002


>> >>> from Tkinter import *
>> >>> r=Tk()
>> >>> e=Entry(r)
>> >>> e.pack()
>> [I enter some text]
>> >>> a=e.get()
>> >>> a+=" ...continue"
>> >>> e.delete(0,END)
>> >>> e.insert(END,a)

> Thanks Matt, I checked out Fredrik Lundh's tutorial and it is very
> useful indeed. The code you posted worked after a little altering no
> problem. I appreciate your help!

You're welcome! Of course, the delete step in my example above is
unnecessary since what you want to do is insert more text. I was
thinking in terms of replacing the text entirely, which I seem to do
more often.

Regards,
Matt



More information about the Python-list mailing list