def play(file): file = os.path.join(stimpath,file); sound=mixer.Sound(file) channel=sound.play() while channel.get_busy(): time.wait(10) def display(text): t = font.render(text, 1, (10, 10, 10)) textpos = t.get_rect() textpos.centerx = background.get_rect().centerx textpos.centery = background.get_rect().centery background.blit(t, textpos) screen.blit(background, (0, 0)) pygame.display.flip() def clear_display(): background.fill((250, 250, 250)) screen.blit(background, (0, 0)) pygame.display.flip() def save(stim,resp): print stim,resp