This is a simple game I'm writing to test the idea of using games to teach C++.
https://learncodethehardway.com/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
519 B
21 lines
519 B
import sys
|
|
import re
|
|
import json
|
|
from datetime import datetime
|
|
|
|
err_re = re.compile("(?P<file>.*?):(?P<line>[0-9]+):(?P<col>[0-9]+): (?P<type>.*?): (?P<message>.*)\n")
|
|
|
|
stats = [];
|
|
|
|
for line in sys.stdin:
|
|
found = err_re.fullmatch(line)
|
|
print(line, end="")
|
|
|
|
if found:
|
|
stats.append(found.groupdict())
|
|
print("FOUND", found.groupdict())
|
|
|
|
with open("stats.json", "a+") as out:
|
|
out.write(json.dumps({"date": datetime.now().isoformat(),
|
|
"messages": stats}));
|
|
out.write("\n")
|
|
|