2020年12月3日

Python 获取文件夹里所有 log 的起止时间戳

摘要: import sys, os def get_timestamp(file_name): cnt = 0; with open(file_name,"r") as f: for line in f.readlines(): line = line.strip() #print (line) if(c 阅读全文

posted @ 2020-12-03 13:22 liujx2019 阅读(558) 评论(0) 推荐(0) 编辑

Python 脚本,计算相邻两条带 token 的 log 的时间差

摘要: import sys, os def get_interval(file_name, key_word): cnt = 0; prev = 0; interval_list = []; with open(file_name,"r") as f: for line in f.readlines(): 阅读全文

posted @ 2020-12-03 13:21 liujx2019 阅读(178) 评论(0) 推荐(0) 编辑

Python3 脚本 解压缩文件夹中的所有gz文件

摘要: import gzip import shutil def gunzip_shutil(source_filepath, dest_filepath, block_size=65536): with gzip.open(source_filepath, 'rb') as s_file, \ open 阅读全文

posted @ 2020-12-03 09:35 liujx2019 阅读(1242) 评论(0) 推荐(0) 编辑

导航