python正则findall

浪尽此生 提交于 2019-11-30 00:44:38
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)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!