title: NameError: class name is not defined, despite being imported
body: <p>I wrote a project with Spyder which contains several module files, such as tester.py and scheduler.py. I created the following classes in tester.py:</p>
  
  <pre><code>class Tester(object):
      def run(self):
          pass
  </code></pre>
  
  <p>When I imported Tester class to the scheduler.py, I got a name error(I used Anaconda Prompt to access the project folder and run <code>python scheduler.py</code>):</p>
  
  <pre><code>from tester import Tester
  class Scheduler():
      def schedule_tester(self):
          getter = Tester()
          while True:
              getter.run()
  
  if __name__ == '__main__':
      scheduler = Scheduler()
      scheduler.schedule_tester()
  
  Traceback (most recent call last):
  NameError: name 'Tester' is not defined
  </code></pre>
  
  <p>Can someone help me figure out, many thanks!</p>