

Python, along with the aforementioned external packages, is completely open-source and might therefore be preferred over MATLAB.
Install psychopy with pylink code#
Although both the Psychophysics and EyeLink toolboxes are freely available, MATLAB itself is expensive software, of which the source code is not available. In combination with the Psychophysics Toolbox (Brainard, 1997) and the Eyelink Toolbox (Cornelissen, Peters, & Palmer, 2002), MATLAB can be used for stimulus presentation and eyetracking using an EyeLink system (SR Research).

With the addition of these packages, Python is a viable alternative to MATLAB (The Mathworks Inc.), a proprietary programming language that is widely used for scientific computing. These include the NumPy and SciPy libraries (Oliphant, 2007) for scientific computing, Matplotlib (Hunter, 2007) for plotting, and PsychoPy (Peirce, 2007, 2009) for stimulus presentation. For scientific use, a number of external packages, which are not part of the Python standard library, but could be regarded as “add-ons,” are available. Python (Van Rossum & Drake, 2011) is an interpreted programming language that does not need pre-compiling, but executes code by statement. These are notoriously difficult to implement using a GEB, although it is technically possible to use PyGaze scripting within a GEB (see the Usability section in the Results below). PyGaze contains functions for easy implementation of complex paradigms such as forced retinal locations, areas of interest, and other gaze-contingent experiments that can be created by obtaining and processing gaze samples in real time. In essence, the individual functionality of a number of existing Python libraries is combined within one package, making stimulus presentation and communication with multiple brands of eyetrackers possible using a unified set of routines. The package is largely platform and eyetracker independent, as it supports multiple operating systems, and eyetrackers of different manufacturers. The result is PyGaze, a package that allows users to create experiments using short and readable code, without compromising flexibility. The aim of the present project was to introduce the ease of GEBs into actual programming, using a mildly object-oriented approach. In the present article, a new toolbox for creating eyetracking experiments using Python is introduced.
