Skip to content

Instantly share code, notes, and snippets.

@lrvick
Created July 7, 2012 11:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lrvick/3065978 to your computer and use it in GitHub Desktop.
Save lrvick/3065978 to your computer and use it in GitHub Desktop.
Quake3 logger for the raspberry pi that outputs to an attached HD44780 LCD using my library for it
from hd44780 import HD44780
from os import stat
from time import sleep
lcd = HD44780()
lcd.message(" Quake3 Logger\nCommence killing...")
logfile_name = 'game.log'
logfile = open(logfile_name,'r')
stats = stat(logfile_name)
size = stats[6]
logfile.seek(size)
while 1:
where = logfile.tell()
line = logfile.readline()
if not line:
sleep(2)
logfile.seek(where)
else:
if '^7' in line:
line = line.replace('^7','')
line = line.replace('^2','')
line = "%s\n%s" % (line[:16],line[16:32])
lcd = HD44780()
lcd.message(line)
LD_LIBRARY_PATH=/opt/vc/lib ./ioquake3.arm 1 &> game.log &
sudo python q3lcd.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment