每天进步一小点

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()

 

posted @ 2018-06-15 10:53  没有永远的小白  阅读(79)  评论(0编辑  收藏  举报