title: Python getting values from class
body: <p>im trying to make an app that runs few files to make it organized, however im kinda lurker in python and got stuck trying to import values from <code>settings.py</code> in <code>main.py</code>.</p>
  
  <p>The error type im getting looks like this depending on how im trying to get the object's value:</p>
  
  <pre><code>self.code = sets.run().self.code
  AttributeError: 'NoneType' object has no attribute 'self'
  </code></pre>
  
  <p>or</p>
  
  <pre><code>self.code = sets.code
  AttributeError: 'settings' object has no attribute 'code'
  </code></pre>
  
  <p>The whole idea is to make get self. values in the other file not using the return but simply specifying the element.</p>
  
  <p>Simple sample code:</p>
  
  <p>Main file:</p>
  
  <pre><code>import settings
  def run():
      sets = settings.settings()
      code = sets.code 
  run()
  </code></pre>
  
  <p>Settings file:</p>
  
  <pre><code>class settings():
      def run(self):
         self.code = somevalue
  </code></pre>
  
  <p>so basicaly that is the minimum extension of what im trying to do, i could return the self.code in run however that is not what i want because i have many settings_values and id like to access them in different files. 
  help much appreciated.</p>
  
  <blockquote>
    <p>Edit:
    So how should i approach this if i need to <code>import settings</code> in <code>main</code> but only run() settings whenever i start running the main_run() and than just get the variables? 
    I dont want to complicate it with saving to file and than reading a list() i need to just access them and only run</p>
    
    <p>basicaly: my settings gets a long list from pickle and than makes some operations that return the code combination and lots of other self.settings that need to be initiated when the program(main) starts and than for the whole While True inside run() the values are fixed unless i start refresh_settings() and change the settings than the data is recompiled and the program returns to while true</p>
  </blockquote>