def removeDuplicates(variable):
 oldList = variable.split(os.pathsep)
 newList = []
 for i in oldList:
  if (i not in newList):
   newList.append(i)
 newVariable = os.pathsep.join(newList)
 return newVariable

def removeDuplicates ( variable ) : oldList = variable . split ( os . pathsep ) newList = [ ] for i in oldList : if ( i not in newList ) : newList . append ( i ) newVariable = os . pathsep . join ( newList ) return newVariable
remove duplicate values of an environment variable .