import os

username = os.getlogin() path = 'C:\Users{}\Documents\PassMark\BurnInTest'.format(username)

fail_found = False for file in os.listdir(path): if 'BIT_log' in file and file.endswith('.log'): with open(os.path.join(path, file), 'r') as f: if 'fail' in f.read(): fail_found = True break

if fail_found: with open(os.path.join(path, 'fail.txt'), 'w') as f: f.write('Fail found in BurnInTest logs') else: with open(os.path.join(path, 'ok.bat'), 'w') as f: f.write('echo BurnInTest passed without errors')

Python脚本:检测BurnInTest日志中是否存在失败,并生成相应文件

原文地址: https://www.cveoy.top/t/topic/nVkc 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录