List of paths

dorzey dorzey at googlemail.com
Wed Apr 1 05:45:06 EDT 2009


You could use the followingm, where the_list is your list. (I'm new to
python so there might be a better way):

toremove = []
for x in the_list:
	for y in the_list:
		if y.startswith(x) and y != x:
			toremove.append(y)

difference  = filter(lambda x:x not in toremove, the_list)



More information about the Python-list mailing list