title: How do I call a class method from another file in Python?
body: <p>I'm learning Python and have two files in the same directory.</p>
  
  <p><code>printer.py</code></p>
  
  <pre><code>class Printer(object):
      def __init__(self):
          self.message = 'yo'
  
      def printMessage(self):
          print self.message
  
  if __name__ == "__main__":
      printer = Printer()
      printer.printMessage()
  </code></pre>
  
  <p>How do I call the <code>printMessage(self)</code> method from another file, <code>example.py</code> in the same directory? I thought <a href="https://stackoverflow.com/a/3856502/270847">this answer</a> was close, but it shows how to call a class method from another class within the same file.</p>