On Fri, May 2, 2008 at 12:55 PM, W W <[EMAIL PROTECTED]> wrote: > I'm playing around with pyGTK, and I have a question to see if I'm > understanding things correctly. > > Is a method just a function inside a class?
Pretty much. It also has a required 'self' parameter which gets the value of the object on which the method is called. > > i.e. > > def myFunction(): > print "This is a function" > > class myClass: > def myMethod(): should be def myMethod(self): > print "This is a method" > > and to call: > > myFunction() > > I tried to call the method via. myClass.myMethod() and > x = myClass This just makes x an alias for the class object. Should be x = myClass() > x.myMethod() then this will work. Kent _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor