python读取txt文件,查找到指定内容,并做出修改答:def modifyip(tfile,sstr,rstr):try:lines=open(tfile,'r').readlines()flen=len(lines)-1 for i in range(flen):if sstr in lines[i]:lines[i]=lines[i].replace(sstr,rstr)open(tfile,'w').writelines(lines)except Exception,e:print e modifyip('a.txt','a','A')...