Python 文本处理 (1.导出书籍目录 2.统计每一章节频度最高的词)
文本处理
待处理文本链接
# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
import re
f=open('d:/八十天环游地球.txt','r')
f2=open('d:/八十天环游地球new.txt','w')
f3=open('d:/八十天环游地球-章节.txt','w')
for i in f:
i=i.rstrip() #去掉右端空格
i=re.sub('&l
原创
2021-12-22 11:35:22 ·
825 阅读 ·
0 评论