#!/usr/bin/python3 import sys f = sys.argv[1] res = [] res.append({}) res.append({}) res.append({}) SAMPLES = 500 with open(f) as fp: for line in fp: s = line.split() mode = int(s[0])-1 if s[1] not in res[mode]: res[mode][s[1]] = float(s[5]) else: if "finished" not in s[5]: res[mode][s[1]] += float(s[5]) else: res[mode][s[1]] += float(s[7]) print("Average times low:") for r in res[0].keys(): print(res[0][r]/SAMPLES) print("Average times medium:") for r in res[1].keys(): print(res[1][r]/SAMPLES) print("Average times high:") for r in res[2].keys(): print(res[2][r]/SAMPLES)