#!/usr/bin/env python3
#coding=utf-8
#Author:jimfg2010
#Update Date:20190730
#Version:v2019.7
import datetime,platform,time,os,sys,stat,re
print('READ ME!!! READ ME!!! READ ME!!! \nPlease make sure your python version later than 3.4, \
put this py file into log folder and remove other logs except fio log,press "Enter" key to continue!!!')
os.system('echo READ ME!!! READ ME!!! READ ME!!! READ ME!!! READ ME!!! READ ME!!! \
Please make sure your python version later than 3.4, put this py file into log folder and remove other logs except fio log,\
press "Enter" key to continue!!! & pause')
if(os.path.exists("filedir.log")):
os.remove("filedir.log")
else:
pass
if(os.path.exists("filedir1.log")):
os.remove("filedir1.log")
else:
pass
os.system('where python >> filedir.log')
fa=open("filedir.log","r+")
dir2=str(fa.readline())
dir3=dir2.replace('python.exe','').replace('\n','')
fa.close()
if(os.path.exists(dir3+"filedir4.log")):
pass
else:
os.system('pip install urllib')
os.system('pip install requests')
os.system('pip install linecache')
os.system('pip install shutil')
os.system('pip install xlrd')
os.system('pip install xlwt')
os.system('pip install openpyxl')
os.system('pip install xlutils')
fb=open(dir3+"filedir4.log","w")
fb.close()
import linecache,requests
from urllib import request
import urllib.request
import shutil,xlrd,xlwt,openpyxl
from xlutils.copy import copy
from openpyxl import load_workbook
f0=open("filelist0.log","w")
f0.write(str(os.listdir(os.getcwd())))
f0.close()
f=open("filelist0.log","r+")
f1=open("filelist1.log","w")
line1=str(f.readline())
#显示原始文件列表
line2=line1.replace('[','').replace(']','').replace("', '",'\r\n').replace("'",'')#整理文件列表为目标列表
f1.write(line2)
f1.close()
f.close()
#去掉空白行列表
f2=open("filelist1.log","r")
f3=open("Test_result_file_name.log","w")
for line in f2:
line=line.strip()
if len(line)!=0:
if 'k' in str(line) or 'K' in str(line):
if 'bw.' not in str(line):
if 'iops.' not in