Tkinter command parameters

Kragen Sitaker kragen at pobox.com
Mon May 20 01:32:57 EDT 2002


lennybonilla at hotmail.com (Lenny) writes:
> self.mybutton = Button(parent, command = func(1))
> self.mybutton.grid()
> 
> def func(number):
> 	print str(number)
> What am I doing wrong?

You want command=lambda: func(1).




More information about the Python-list mailing list