title: How do I access inherited variables from another module when they are changed in parent?
body: <p>I have a file a.py</p>
  
  <pre><code>avariable = None
  
  class a():
  
    def method(self):
      global avariable
      avariable = 100
      print "variable is", avariable
  </code></pre>
  
  <p>and a file b.py</p>
  
  <pre><code>from a import *
  
  class b(a,):
  
    def mymethod(self):
      a().method()
      print "avariable is " , avariable
  
  if __name__ == '__main__':
    b().mymethod()
  </code></pre>
  
  <p>File <code>b</code> imports everything from <code>a</code> and also inherits from <code>a</code>.
  <code>a</code>'s <code>method</code> is called and the <code>avariable</code> is change to 100 but when I print <code>avariable</code> in b the value is <code>None</code>. How to I use in class <code>b</code> the variable <code>avariable</code> that <code>a</code> class changed?</p>
  
  <p>Output:</p>
  
  <pre><code>&gt;python b.py 
  variable is 100
  avariable is  None
  </code></pre>
  
  <p><strong>Clarification</strong>  </p>
  
  <p>It's crucial for me to use </p>
  
  <pre><code>from a import *
  </code></pre>
  
  <p>because I have already code in class b that calls methods of class a using the syntax</p>
  
  <pre><code>self.method()
  </code></pre>
  
  <p>and that cannot change.</p>
  
  <p>i.e.</p>
  
  <pre><code>from a import *
  class b(a):
  
    def mymethod(self):
      self.method()
      print "avariable is " , avariable
  
  if __name__ == '__main__':
    b().mymethod()
  </code></pre>
  
  <p>So is there a way to access the variable <code>avariable</code> in a without <strong>prefixing</strong> in any way the
  <code>avariable</code>?</p>