python逐行读取替换文件中的字符串

用列表中的值逐行替换文件中符合条件的字符串,并保存为新的文件, open("file").readlines 方案1: 逐行替换并保存为新的文件 import re def replace_string1(): new_name_list = ["string1", "string11", "str
posted @ 2022-05-05 21:56  Gloria_Chen  阅读(422)  评论(0编辑  收藏  举报