上传者: 38660058
|
上传时间: 2021-12-13 09:03:32
|
文件大小: 25KB
|
文件类型: -
核心代码
# -*- 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