import reimport codecsoperation_list = []operation_list_sort = []with codecs.open(r'C:\Users\Administrator.SC-201812211013\PycharmProjects\untitled29\yiwoqu\code\xianbingshi_write.txt','r','utf8') as f: for line in f: line = re.findall('行.*?术',line) operation_list.append(line)for line in operation_list: if line not in operation_list_sort: operation_list_sort.append(line)for line in operation_list_sort: for line in line: print(line)
来源:https://www.cnblogs.com/yiwoqu/p/11542069.html