1 # -*- coding: utf-8 -*- 2 # -*- 先解压日志文件压缩包-*- 3 # -*- 在已经解压的文件包里面找到目标excel文件 -*- 4 # -*- 将文件路径作为列表返回,获取路径下文件,读取复制到新excel文件-*- 5 # -*- 将数据表格自动生成 -*- 6 import sys 7 import time 8 import os 9 from datetime import datetime 10 #import _thread 11 #import multiprocessing as mp 12 import time 13 #from UnzipLogFile import UnzipLogFile 14 from Find_Excel_From_Dir import Search_Excel_From_Dir 15 from Copy_Excel_To_Excel import Copy_Excel_to_Excel 16 ''' 17 from CheckMRSLogHandler import CheckMRSLogHandler 18 from mrs_vgw_handler import MRSVGWHandler 19 from mrs_rec_man_handler import MrsRecManHandler 20 ''' 21 #分支代码会切换文件目录 22 path_start = os.getcwd() #os.getcwd() 方法用于返回当前工作目录 23 # 格式化打印启动时间 24 start_time = datetime.now() 25 print(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())) 26 ''' 27 runUnzip = UnzipLogFile("D:广东应急厅巡检日志") 28 runUnzip.Run() 29 ''' 30 Search_EXCEL = Search_Excel_From_Dir() 31 Csv_list = Search_EXCEL.Run() 32 33 #切换到原本文本目录 34 os.chdir(path_start) 35 New_excel = Copy_Excel_to_Excel() 36 New_excel.Run() 37 38 ''' 39 mrs_vgw_run = MRSVGWHandler("d:日志巡检存放路径",days) 40 P_mrs_vgw = mp.Process(mrs_vgw_run.run()) 41 P_mrs_vgw.start() 42 43 44 mrs_rec_man_run = MrsRecManHandler("d:日志巡检存放路径",days) 45 P_mrs_rec_man = mp.Process(mrs_rec_man_run.run()) 46 P_mrs_rec_man.start() 47 48 P_mrs_vgw.join() 49 P_mrs_rec_man.join() 50 51 runCheckMRS = CheckMRSLogHandler("d:日志巡检存放路径",days) 52 runCheckMRS.run() 53 ''' 54 55 # 格式化打印结束时间 56 print(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())) 57 end_time = datetime.now() 58 print("一共花费%s秒" % (end_time - start_time).seconds)