title: How to change class object parameters from another module (python)
body: <p>So I've searched around and couldn't find an answer. I'm looking to change parameters from an object created in my main file, in a module. For example, I'm testing this with a simple piece of code here:</p>
  
  <p>-this is my main file, from which i create the objects and define some properties</p>
  
  <pre><code>import class_test_2
  
  class dog():
      name=''
      spots=0
  
      def add_spots(self):
          self.spots+=1
  
  def main():
  
      fido=dog()
      fido.name='Fido'
  
      print('Fido\'s spots: ',fido.spots)
  
      fido.add_spots()
  
      print('Fido\'s spots: ',fido.spots)
  
      class_test_2.class_test()
  
      print('Fido\'s spots: ',fido.spots)
  
  
  if __name__=='__main__':
      main()
  </code></pre>
  
  <hr>
  
  <p>-this is the module, from which I want to use functions to change the attributes in the main file</p>
  
  <pre><code>from class_test_1 import dog
  
  def class_test():
      fido.add_spots()
  </code></pre>
  
  <p>-So my question is how can I do this/why doesn't this piece of code above work? 
  Running the main function on its own shows fido's spots increasing by 1 each time its printed. Running the code calling the module however gives a NameError so my module isn't recognising the class exists even though I've managed to import it. Thanks in advance for any help.</p>