Well it depends what you mean. If you have a critter object and want
to invoke its method inside the farm, do somethinh like this.
class Farm_class(object):
  def feed(self, critter):
    critter.eat(self.food)

or if you want to use a method of the Critter class within the farm do

class Farm_class(object):
  def count(self):
    print Critter_class.count()

On Tuesday, June 21, 2011, Andre Engels <andreeng...@gmail.com> wrote:
> On Tue, Jun 21, 2011 at 10:12 AM, David Merrick <merrick...@gmail.com> wrote:
>> I need help using Class methods in another class. I have a class called
>> Critter and I want to create two critters in a farm  Class Farm and use
>> Class Critter's methods
>
> Could you please specify where your current code does not suffice -
> where does it something different than you want, or where do you want
> to do something (and why) that you don't know how to do?
>
> --
> André Engels, andreeng...@gmail.com
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to