title: Access class instance from one file in another file?
body: <p>I have two files, both are in the same project (part of a web scraping framework).  File1 processes items that are generated by File2.  In File2 I have a function that prints out some basic stats about the processes (counts of how many items have been generated, etc).  I have counts in File1 that I would like to print with the stats from File1 but am unsure of how to do that.  Take a look at the example code.</p>
  
  <p>FILE 1:</p>
  
  <pre><code>class Class1(object):
      def __init__(self):
          self.stats = counter("name") #This is the instance that I'd like to use in File2
          self.stats.count = 10
  
  class counter:
      def __init__(self, name):
          self.name = name
          self.count = 0
      def __string__(self):
          message = self.name + self.count
          return message
  </code></pre>
  
  <p>FILE 2: (this is what I'd like to do)</p>
  
  <pre><code>from project import file1 # this import returns no error
  
  def stats():
      print file1.Class1.stats # This is where I'm trying to get the instance created in Class1 of File2.
      #print file1.Class1.stats.count # Furthermore, it would be nice if this worked too.
  </code></pre>
  
  <p>ERROR:</p>
  
  <pre><code>exceptions.AttributeError: type object 'Class1' has no attribute 'stats'
  </code></pre>
  
  <p>I know that both files are running, thus so does the 'stats' instance of the 'counter' class, because of other methods being printed out when running the project (this is just a stripped down example.  What am I doing wrong here?  Is this possible to do?</p>