title: Python Problems with exec
body: <p>I call</p>
  
  <pre><code>exec(compile(open(self.filename, "rb").read(), self.filename, 'exec'))
  </code></pre>
  
  <p>in the init method of my entity class, which loads spider.py:</p>
  
  <pre><code>import util, colors, random
  
  self.dtouch = False
  
  def touch2(self, entity):
      self.level.ps.add_particle(self.get_rect().x + random.randint(0, 31), self.get_rect().y + random.randint(0, 31), 0, -5, 2, 2, colors.RED, 500 + random.randint(0, 50))
  </code></pre>
  
  <p>and when the player touches the spieder, I call <code>touch2(entity)</code> in my orginal touch method to execute the code in the touch2 method from spider.py.
  But when I do this, I get this error:</p>
  
  <pre><code>NameError: name 'touch2' is not defined
  </code></pre>
  
  <p>Does anyone know, how I can call the method from the other class I loaded in init?</p>
  
  <p>Edit: Import Lib doesn't work... Can someone tell me how I can fix that error and use the method from the class which I loaded which exec?</p>