核心代码 # -*- coding: utf-8 -*- ''' python读取英文文件,将每个单词按照空格分开,并将每个单词独自放一行 ''' def dcfenhang(infile,outfile): infopen = open(infile,'r',encoding='utf-8') outopen = open(outfile,'w',encoding='utf-8') lines = infopen.readlines() for line in lines: for db in line.split(): if db not in out