Remove duplicate elements from a list:
newList = dict([(item, 1) for item in oldList]).keys()
Or, if you have Python 2.3 or newer, you can use a Set object to collapse your list:
import sets newList = list(sets.Set(oldList))
dataimportlanguagesprogrammingpythonsetsyntax