title: Handle Error: Not a directory python
body: <p>I get the following error:</p>
  
  <pre><code>[Errno 20] Not a directory:
  </code></pre>
  
  <p>What I have tried so far:</p>
  
  <pre><code>for i in range(3):
      numOfData = len(dir_2[i])
      try:
          for j in range(numOfData):
              print os.listdir(os.path.join(dir_1[i], dir_2[i][j]))
      except OSError:
          print "Hello"
  </code></pre>
  
  <p>Is there a better way to handle this?</p>