import sys, pygame, datetime, os, re pygame.init() size = width, height = 1024, 768 black = 0, 0, 0 white = 255, 255, 255 #Set Current Directory to Presentation Directory os.chdir("C:\presentation") #Load Configuration File confile = open("config.ini", "r") screen = pygame.display.set_mode(size) #Load Safety Countdown Page Image safimg = pygame.image.load("safety.jpg").convert() dfont = pygame.font.SysFont("monospace",15) intpatt = re.compile("[0-9]") #Read Configuration for line in confile: if line[:5] == "TIMER": wtime = "".join(re.findall(intpatt,line)) if line[:5] == "MONTH": imon = "".join(re.findall(intpatt,line)) if line[:3] == "DAY": iday = "".join(re.findall(intpatt,line)) if line[:4] == "YEAR": iyear = "".join(re.findall(intpatt,line)) if line[:9] == "INCIDENTS": iinc = "".join(re.findall(intpatt,line)) incdate = datetime.date(iyear, imon, iday) numdays = datetime.datetime.now() - incdate daysurf = dfont.render(numdays, 1, (255,255,255)) #Set Directory to Picture Directory os.chdir("C:\presentation\images") while 1: for event in pygame.event.get(): if event.type == pygame.QUIT: sys.exit() screen.blit(safimg,(0, 0)) screen.blit(daysurf,(200,200)) pygame.display.flip()