# with open('小护士班主任',encoding='utf-8') as f,open ('小护士班主任.bak','w',encoding='utf-8')as f2: # for line in f: # if '星儿' in line: # line = line.replace('星儿','阿娇') # #写文件 # f2.write(line) # import os # os.remove('小护士班主任')#删除文件 # os.rename('小护士班主任.bak','小…