You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

12 lines
264 B

def pparent(paths):
paths = sorted(paths,key=len)
first = True
ret = []
while len(paths) > 0:
el1 = old_paths[0]
old_paths = paths[1:]
paths = []
for path in old_paths:
if not paths.startswith(el1):
paths.insert(0,path)
return ret