def pathsplit(path):
 result = []
 (head, tail) = _os.path.split(path)
 if ((not head) or (head == path)):
  pass
 else:
  result = pathsplit(head)
 if tail:
  result += [tail]
 return result

def pathsplit ( path ) : result = [ ] ( head , tail ) = _os . path . split ( path ) if ( ( not head ) or ( head == path ) ) : pass else : result = pathsplit ( head ) if tail : result += [ tail ] return result
split a path into a list of elements of the file system hierarchy .