I have a txt file
the text file looks like this:
Still not working.
['None']['Vega~']['Vega~']['Vega~']['8^)->-<']['violence']['puker']['Zanaz']['Funk']['8^)->-<']['8^)->-<']['8^)->-<']['Vega~']['violence']['Zanaz']['Funk']['puker']['Vega~']['Vega~']['Vega~']['8^)->-<']['violence']['puker']['Zanaz']['None']['Lawn']['Lawn']['Lawn']['Leafy']['Judge69']['David']['lilwade']['Pity.']['artofwar']['Hazecloud']['Lawn']['Lawn']['Lawn']['Judge69']['Leafy']['David']['lilwade']['Hazecloud']['Lawn']['Lawn']['Lawn']['Leafy']['David']['Pity.']['lilwade']['artofwar']['Judge69']
I need to remove all the duplicates so each name should only show one time, also it must keep the order they are in.
fo = open('C:\Python26\myfile.txt','r')
name_cache = fo.readlines()
typea = name_cache[0]
def unique_list(l):
ulist = []
[ulist.append(x) for x in l if x not in ulist]
return ulist
mast =' '.join(unique_list(typea.split()))
print mast