Re: [Tutor] Accessing methods in same class

2011-11-06 Thread Max S.
Oh. Sorry. It's 500 lines, so I'll just post an example. Windows Vista and Python 3, just because I forgot. class K: def __init__(self): doThis() def doThis(self): print("Hi.") k = K() >From what I understand by your help, the code class K: def __init__(self): self.doThis() def doThis(s

Re: [Tutor] Accessing methods in same class

2011-11-06 Thread Peter Lavelle
Hi, Could you post a copy of the code you are working on, so we can help you better with this? Usually, when calling a method in the same class you use the syntax: self.method_name() 'self' refers to an attribute or method within the same class. Sorry, if this does not help you. Regards

Re: [Tutor] Accessing methods in same class

2011-11-06 Thread Hugo Arts
On Sun, Nov 6, 2011 at 9:59 PM, Max S. wrote: > Hi.  I'm working on a project for my friend, but I'm running into errors. > No matter what I do, I can't seem to get one method to execute another > method in the same class.  Is there a way that I can do this?  Thanks. > Yes, you can do this, and i

[Tutor] Accessing methods in same class

2011-11-06 Thread Max S.
Hi. I'm working on a project for my friend, but I'm running into errors. No matter what I do, I can't seem to get one method to execute another method in the same class. Is there a way that I can do this? Thanks. ___ Tutor maillist - Tutor@python.org