title: Python: AttributeError: 'module' object has no attribute 'append'
body: <p>I'm trying to make an engine that takes the contents of a file that has python files and functions within them in a format as follows:</p>
  
  <pre><code>lib1 func1 func2 func3
  lib2 func4
  </code></pre>
  
  <p>etc.  I set up a test with two python files and three functions, but the code I am using to import the libraries and functions isn't working:</p>
  
  <pre><code>class engine (object):
      def __init__ (self, sceneFile):
          # gets contents of sceneFile, then closes
          scenes         = open (sceneFile, 'r')
          lines = scenes.readlines ()
          scenes.close ()
          self.libs = []
  
          # finds functions and libraries
          for i in range (len (lines)):
              lineContents = lines[i].split()
              self.libs.append (importlib.import_module (lineContents[0]))  # libraries in sceneFile
              for j in range (len (lineContents) - 1):
                  self.libs[i].append (lineContents[j + 1])          # functions in sceneFile
  
      def start (self, nextScene):
          # finds function and library, imports
          for i in range (len (self.libs)):
              for j in range (len (self.libs[i])):
                  if self.libs[i][j] == nextScene:
                      nextScene = getattr (self.libs[i], self.libs[i][j])
                      self.start (nextScene)
  </code></pre>
  
  <p>When I try running this with the test programs, this error pops up:</p>
  
  <pre><code>Traceback (most recent call last):
    File "ugsE.py", line 32, in &lt;module&gt;
      Engine = engine ("ugsEtest.txt")
    File "ugsE.py", line 21, in __init__
      self.libs[i].append (lineContents[j + 1])          # functions in sceneFile
  AttributeError: 'module' object has no attribute 'append'
  </code></pre>
  
  <p>What does this mean? I have a feeling that it's because I'm creating a list of modules, but shouldn't that work?</p>