[Tutor] Tkinter entry box text changed event
Alan Gauld
alan.gauld at yahoo.co.uk
Mon Apr 10 14:40:01 EDT 2017
On 10/04/17 10:18, Phil wrote:
> def my_method(self.event):
> print("method called")
>
> (self.event) is a syntax error and if I leave off "self", this is the result:
You want two parameters
self becaiuse its a method of a class so must have a self
event which is the event passsed by the GUI
So:
def my_method(self, event):
print("method called with ",event)
> I must be close, surely.
A comma instead of a dot...
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos
More information about the Tutor
mailing list