Command config, quitting, binary, Timer

Peter Hansen peter at engcorp.com
Sat Sep 3 22:33:34 EDT 2005


bearophileHUGS at lycos.com wrote:
> I am still ignorant about Tkinter. This little program, after pressing
> the "Go" eats more and more RAM, is it normal? Can it be avoided? (In
> normal programs this is isn't a real problem).
> 
> ! import Tkinter
> ! def dogo():
> !     while 1:
> !         b.config(command=lambda:None)
> ! root = Tkinter.Tk()
> ! b = Tkinter.Button(root, text="Go", command=dogo)
> ! b.pack()
> ! root.mainloop()

What did you expect to happen with the infinite loop inside dogo()? 
Wouldn't it call b.config() over and over again, never returning?  Is 
that really what you wanted?

-Peter



More information about the Python-list mailing list