Bind event is giving me a bug.

Peter Otten __peter__ at web.de
Wed Jan 15 16:25:31 EST 2014


MRAB wrote:

> This will make it call 'get_text' when the button is clicked:
> 
>> Button(root, text = "Submit", command = get_text).pack()

...and then produce a TypeError because of the missing `event` argument. To 
avoid that you can provide a default with

def get_text(event=None):
    ...




More information about the Python-list mailing list