Re: Class Help

2005-10-02 Thread Ivan Shevanski
Thanks everyone for helping me out and tolerating the noob question =D The last part was confusing to me and thanks for explaining it so I get it! -Ivan _ Express yourself instantly with MSN Messenger! Download today - it's FREE!

Re: Class Help

2005-10-02 Thread Fredrik Lundh
Ivan Shevanski wrote: > To continue with my previous problems, now I'm trying out classes. But I > have a problem (which I bet is easily solveable) that I really don't get. > The numerous tutorials I've looked at just confsed me.For intance: > > >>>class Xyz: > ... def y(self): > ...

Re: Class Help

2005-10-01 Thread Peter
Ivan Shevanski wrote: >To continue with my previous problems, now I'm trying out classes. But I >have a problem (which I bet is easily solveable) that I really don't get. >The numerous tutorials I've looked at just confsed me.For intance: > > > class Xyz: >... def y

Re: Class Help

2005-10-01 Thread Steven D'Aprano
On Sat, 01 Oct 2005 18:58:45 -0400, Ivan Shevanski wrote: > To continue with my previous problems, now I'm trying out classes. But I > have a problem (which I bet is easily solveable) that I really don't get. > The numerous tutorials I've looked at just confsed me.For intance: [code snipped]

Re: Class Help

2005-10-01 Thread Ron Adam
Ron Adam wrote: > Also, > > In your example 'q' is assigned the value 2, but as soon as the method > 'y' exits, it is lost. To keep it around you want to assign it to self.y. Ooops, That should say ... "To keep it around you want to assign it to self.q." <---self.q Cheers, Ron -- http

Re: Class Help

2005-10-01 Thread Jean-François Doyon
You have to crate an instanciation of the class before you can use one. So you want to do: instance = Xyz() instance.y() You won't get any output though, might want to do: class Xyz: def y(self): print 'y worked!' it's more satisfying :) Basically, look into the difference betwe

Re: Class Help

2005-10-01 Thread marduk
On Sat, 2005-10-01 at 18:58 -0400, Ivan Shevanski wrote: > To continue with my previous problems, now I'm trying out classes. But I > have a problem (which I bet is easily solveable) that I really don't get. > The numerous tutorials I've looked at just confsed me.For intance: > > >>>class Xyz:

Re: Class Help

2005-10-01 Thread Ron Adam
Ivan Shevanski wrote: > To continue with my previous problems, now I'm trying out classes. But > I have a problem (which I bet is easily solveable) that I really don't > get. The numerous tutorials I've looked at just confsed me.For intance: > class Xyz: > > ... def y(self): > ...