def PathSplit(f): paths = [] cur = f while True: cur, piece = pathtools.split(cur) if piece == '': break paths.append(piece) paths.reverse() return paths