首页 > 其他 > 详细

file_object

时间:2019-01-03 21:11:27      阅读:193      评论:0      收藏:0      [点我收藏+]

#!/use/bin/python
#encoding=utf-8

filename="WinPMT.log"
filename_1="WinPMT_stress.txt"

with open(filename_1,"w") as file_object_1:
    file_object_1.write("")
with open(filename) as file_object:
    lines=file_object.readlines()

for line in lines:
    if "error"in line or "Cycle:" in line:
        print(line)
        with open(filename_1,‘a‘) as file_object_1:
            file_object_1.write(line)

file_object

原文:https://www.cnblogs.com/zzl112893/p/10168965.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!