[Tutor] after(), how do I use it?

Alan Gauld alan.gauld at btinternet.com
Tue Apr 26 09:40:41 CEST 2011


"michael scott" <jigenbakuda at yahoo.com> wrote

> Now I understand what I misunderstood. Well he imported Tkinter as 
> tk, so I
> thought if it belonged to Tkinter it would be tk.after(), but the 
> after was
> attached to the app, so it was in actuality app.after() . app 
> inherits from the
> tk class (taking with it all its methods), so its a built in 
> function of
> tkinter.

To be pedantic its a method of tkinter since its
part of a class definition. For the distinction between
a function and a method see yesterday's thread
"Unbound Method Error"

One pragmatic difference between them is that help
on functions is located in module level documentation,
help on methods is located in class level documentation.
So recognising a method call helps in directing the
search for help!

HTH,


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/




More information about the Tutor mailing list