def list_path_traversal(path):
 out = [path]
 (head, tail) = os.path.split(path)
 if (tail == ''):
  out = [head]
  (head, tail) = os.path.split(head)
 while (head != out[0]):
  out.insert(0, head)
  (head, tail) = os.path.split(head)
 return out

def list_path_traversal ( path ) : out = [ path ] ( head , tail ) = os . path . split ( path ) if ( tail == '' ) : out = [ head ] ( head , tail ) = os . path . split ( head ) while ( head != out [ 0 ] ) : out . insert ( 0 , head ) ( head , tail ) = os . path . split ( head ) return out
returns a full list of directories leading up to .