疯狂填词 156 整个替换 仅仅只需要循环需要替换的单词:直接用字符串的方法stringname.replace(目标字符,新字符)来替换即可 import os # 读取文本文件 f = open('D:\\code1\\project1\\pre.txt') nf = open('D:\\code1\\project1\\pre_after.txt','w') # 所有ADJECTIVE NOUN ADVERB VERB 替换 string.replace(new,old) article = f<