get() in Tkinter

Andrew M stopviequesbombing at hotmail.com
Sat Aug 31 18:03:31 CEST 2002


> Dear Andrew,
> You're right that it's the insert call that's the problem. You have to
> call insert() with an index. And it turns out to be necessary to
> delete the previous text first. Something like this:
>
> >>> 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)
>
> The best documentation for Tkinter that I know of is Fredrik Lundh's
> excellent An Introduction to Tkinter. It's at:
>
> http://www.pythonware.com/library/tkinter/introduction/index.htm
>
> I almost always have a local copy open when I'm doing Tkinter
> programming.
>
> Regards,
> Matt

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!





More information about the Python-list mailing list