calling functions from Tk

bowman bowman at montana.com
Sat Dec 25 12:04:10 EST 1999


scoobysnax5336 at my-deja.com <scoobysnax5336 at my-deja.com> wrote:

>b=Button(root, text="Call test('blah')", width=12, command=test('blah'))

Welcome to the world of lambda. 'command' only takes the address of the 
callback function, not a function and its parameters. Try

command= lambda : test('blah')

This is covered in the sidebar on page 113 of Learning Python, BTW.




More information about the Python-list mailing list