标签:new odi open close %x ftime time ace hello
file=open(‘yesteerday‘,‘r‘,encoding=‘utf-8‘) file_new=open(‘yesteerday1‘,‘w‘,encoding=‘utf-8‘) for line in file: if "逯晓华" in line: line=line.replace(‘逯晓华‘,‘hello 逯晓华‘) time_import=‘%Y-%m-%d %X‘ time_current=time.strftime(time_import) file_new.write(time_current) file_new.write(line) file.close() file_new.close()
标签:new odi open close %x ftime time ace hello
原文地址:https://www.cnblogs.com/yuanke98/p/9186354.html