【发布时间】:2013-08-20 02:58:16
【问题描述】:
我有一个包含多行文本的 txt 文件 (myText.txt)。
我想知道:
- 如何创建需要删除的单词列表(我想自己设置单词)
- 如何创建需要替换的单词列表
例如,如果 myText.txt 是:
The ancient Romans influenced countries and civilizations in the following centuries.
Their language, Latin, became the basis for many other European languages. They stayed in Roma for 3 month.
- 我想删除我想替换的“the”“和”“in” “古老”的“古代”
- 我想替换“月”和“世纪” 按“年”
【问题讨论】:
标签: python string file-io replace