title: Python: How to call a method from another module?
body: <p>I have 2 files written in python. main.py looks like this:</p>
  
  <pre><code>import cats
  
  class Dog():
      def __init__(self, name):
          self.name = name
      def talk(self):
          print("My name is "+self.name)
  
  dog = Dog("Boxer")
  cats.cat.talk()
  </code></pre>
  
  <p>and cats.py that looks like this:</p>
  
  <pre><code>class Cat():
      def __init__(self, name):
          self.name = name
      def talk(self):
          print("my name is "+self.name)
      def MakeDogTalk(self):
          dog.talk()
  cat = Cat("pus")
  cat.MakeDogTalk()
  </code></pre>
  
  <p>as you can see, i am trying to make the dog talk from the cats module, is there some way to make this work? My real world app looks nothing like this btw...
  of course,now i get this error:</p>
  
  <pre><code>line 9, in MakeDogTalk 
  dog.talk()
  NameError: name 'dog' is not defined
  </code></pre>