disp = Display() # initialize a screen scr = Screen() # initialize an EyeTracker tracker = EyeTracker(disp) # initialize a keyboard kb = Keyboard(keylist=['space'], timeout=None) # initialize a sound snd = Sound(soundfile=soundfile) # initialize a Timer timer = Time() # create a new logfile log = Logfile(filename="test") log.write(["test", "time"]) # # # # # # welcome scr.draw_text("Welcome to the PyGaze Supertest!\n\nYou're going to be testing \ your PyGaze installation today, using this interactive tool. Press Space \ to start!\n\n\nP.S. If you see this, the following functions work: \ \n- Screen.draw_text \ \n- Disp.fill \ \n- Disp.show \ \nAwesome!")
fulltimenow = datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S") datenow = datetime.datetime.now().strftime("%Y-%m-%d") subjectNumber = "0" + str(newSubject.subject_number) if len( str(newSubject.subject_number)) < 2 else str(newSubject.subject_number) logfolderpath = os.path.join( c.LOGDIR, "{0}_{1}_{2}".format(subjectNumber, newSubject.subject_code, fulltimenow)) if not os.path.exists(logfolderpath): os.makedirs(logfolderpath) logfilepath = os.path.join( logfolderpath, "s{0}_{1}_{2}".format(subjectNumber, newSubject.subject_code, datenow)) # initialize a Timer timer = Time() # initialize the display for stimuli disp = Display(disptype="psychopy", dispsize=c.TOBII_DISPSIZE, screennr=0, bgc="grey") # initialize a tobiitracker tracker = InfantTobiiTracker(disp, logfilepath) # create a new logfile (for TESTing purposes only) eventlog = Logfile(filename="{0}\subj{1}_caliblog_{2}".format( logfolderpath, subjectNumber, datenow)) eventlog.write([ "\nDate and time of experiment: {0}".format(
# initialize a mouse mouse = Mouse(mousebuttonlist=None, timeout=None) # initialize a sound snd = Sound(osc='sine', freq=4400, length=3000) sounds = { 'a sine wave (slightly oscillating)':Sound(osc='sine', freq=440, length=5000, attack=1000, decay=1000), 'a saw wave':Sound(osc='saw', freq=880, length=5000, attack=0, decay=0), 'a square wave':Sound(osc='square', freq=1760, length=5000, attack=0, decay=0), 'white noise':Sound(osc='whitenoise'), 'soundfile':Sound(soundfile=soundfile) } # initialize a Timer timer = Time() # create a new logfile log = Logfile(filename="test") log.write(["test", "time"]) # # # # # # welcome scr.draw_text("Welcome to the PyGaze Supertest!\n\nYou're going to be testing \ your PyGaze installation today, using this interactive tool. Press Space \ to start!\n\n\nP.S. If you see this, the following functions work: \ \n- Screen.draw_text \ \n- Disp.fill \ \n- Disp.show \
disp = Display() # initialize a screen scr = Screen() # initialize an EyeTracker tracker = EyeTracker(disp) # initialize a keyboard kb = Keyboard(keylist=['space'],timeout=None) # initialize a sound snd = Sound(soundfile=soundfile) # initialize a Timer timer = Time() # create a new logfile log = Logfile(filename="test") log.write(["test", "time"]) # # # # # # welcome scr.draw_text("Welcome to the PyGaze Supertest!\n\nYou're going to be testing \ your PyGaze installation today, using this interactive tool. Press Space \ to start!\n\n\nP.S. If you see this, the following functions work: \ \n- Screen.draw_text \ \n- Disp.fill \ \n- Disp.show \