Beginning with PsychoPy

Important links:

PsychoPy is a free, opensource software package for creating experiments in Python. PsychoPy’s Builder View interface makes it easy to create experiments even if you do not have any coding background. This website will go through some basic usage instructions for PsychoPy (and its online experiment platform, Pavlovia), along with instructions for running some custom paradigms used in K-State’s cognitive psychology labs.

After installing PsychoPy, you have the choice of two different ways of working with the program: Builder View and Coder View. Both will come up when you start PsychoPy, but for the purposes of this website, all instructions will be given in reference to the Builder View.

Coder View: example Builder View: example Builder View still allows for the use of custom code, while doing most of the heavy lifting of creating the Python (or JavaScript) code for you. I recommend Builder View even for experienced programmers! For more detailed Coder View information, see the documentation here.

In Builder View, the experiment layout is shown at the bottom, in the Flow section. Consider this a timeline of your experiment. The building blocks of the experiment are Routines and Loops. Routines tell the software what to do (present stimuli, take in user input, run calculations, etc.) , and Loops tell the software how many times to repeat certain routines. A good way to familiarize yourself with PsychoPy when first starting is by checking out the Demos included in your install. From Builder View, these can be opened by clicking Demos right at the top of the window. There are also video demos included at the bottom of this page.

The Routine window is similarly laid out in a timeline-style, which is useful for visually checking when some of your experiment Components start and end. The Components, accessed from the pane to the right of the Routines window, include the stimuli you can present in your experiment (like pictures, shapes, videos, sounds, etc.), as well as the responses you plan on collecting from your participants (like keyboard or mouse click responses). For both stimuli and responses, you can set at which point in time the component begins and ends. If you would like a button press to end a routine, check the “force end routine” box in that response component’s details.

More detailed information on the builder view and specific components can be found here. PsychoPy also has a detailed page describing the usage of a data source file for making blocks of trials and counterbalancing. That can be found here. PsychoPy has a YouTube page with tutorials that are greatly helpful. A full playlist can be found here. The Posner example in particular is very informative in illustrating how to use a data file to display different visual content within one routine. If you are interested in learning more in a hands-on manner, Open Science Tools holds official PsychoPy online workshops regularly. I recommend checking one out if you are able! More information can be found here: https://workshops.psychopy.org/.