码迷,mamicode.com
首页 > 其他好文 > 详细

每天进步一小点

时间:2018-06-15 12:49:42      阅读:142      评论:0      收藏:0      [点我收藏+]

标签: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

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!