1 # coding=utf-8 2 import os 3 4 path = "C:\Users\leo\Desktop\ciku" 5 os.chdir(path) 6 f = open("dic.txt", 'r+') 7 file_list = f.readlines() 8 dataset = [] 9 for line in file_list: 10 dataset.append(line) 11 data = set(dataset) 12 f1 = open("final.txt", "w+") 13 for i in data: 14 f1.write(i)