Skip to content

Instantly share code, notes, and snippets.

@dmitrydyomin
Last active September 21, 2015 10:31
Show Gist options
  • Save dmitrydyomin/59acbe7f3a47c9ab27ac to your computer and use it in GitHub Desktop.
Save dmitrydyomin/59acbe7f3a47c9ab27ac to your computer and use it in GitHub Desktop.
Simple Quake III Arena log analyser (scores only)
import re
with open("games.log", "r") as myfile:
data = myfile.read()
results = {}
players = {}
for time, score, ping, name in re.findall('(\d+:\d+)\s+score:\s+([-\d]+)\s+ping:\s+(\d+)\s+client:\s+\d+\s+(.*)', data):
if not time in results:
results[time] = {}
results[time][name] = score
players[name] = name
print "\t".join(players)
for time, game in results.iteritems():
scores = []
for player in players:
scores.append(game[player] if player in game else '')
print "\t".join(scores)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment