title: IndexError: list index out of range error
body: <p>I am still a beginner with python and xml. The following error is bothering me too much. The following is the traceback mess that I get (an error) while executing the following code:</p>
  
  <pre><code>Traceback (most recent call last):
    File "path", line 66, in &lt;module&gt;
      print slidename[a].childNodes[0].nodeValue
  IndexError: list index out of range
  </code></pre>
  
  <p>from this code:</p>
  
  <pre><code>for object in os.listdir(my_directory):
        print (object)
        if '.zip' in object:
              #print (object)
              new = os.path.splitext(object)
              #print (new[0])
              file_name.append(new[0])
              os.mkdir(my_directory+new[0], 0o777)
              with zipfile.ZipFile(my_directory+new[0]+new[1], "r") as z:
                  z.extractall(my_directory+new[0])
  
  count = 0
  
  for len_num in range(0,len(file_name)):
  
      for doc in os.listdir(my_directory+file_name[len_num]+new_directory):
              if '.xml' in doc:
                    #print doc
                    slide_name = os.path.splitext(doc)
                    #print slide_name
                    print ((file_name)[len_num])+'&gt;&gt;&gt;'+((slide_name)[0])
                    file= xml.dom.minidom.parse(my_directory+((file_name)[len_num])+new_directory+doc)
                    tagname = file.getElementsByTagName('a:t')
                    #print tagname
  
                    for a in range(0,len(tagname)):
                          print tagname[a].childNodes[0].nodeValue
  </code></pre>
  
  <p>Thanks in advance!!</p>