Wilbert's website at SocSci

has a subtitle

psychopy/00intro.html 2017-04-04

Programming with PsychoPy, 0 Introduction

An introductory programming guide for time-accurate experiments

Daniel von Rhein
Pascal de Water
Wilbert van Ham

This course was written by Daniel von Rhein, Pascal de Water and Wilbert van Ham for the Faculty of Social Sciences of the Radboud University Nijmegen. It is an adaptation of the course written by the first two authors, for NBS Presentation for the Donders Institute.

Introduction (Aim of the course)

PsychoPy is a multi platform (Windows, Linux, Mac) based programming tool that allows experimenters to set up and program all sort of experiments. Along with NBS Presentation it is the recommended software for time-accurate experiments and therefore supported by the Faculty of Social Sciences' Technical Support Group (TSG).

The TSG offer (PhD) students a couple of preprogrammed experiments (i.e. templates), which can be adjusted to build up own experiments. In this way, the PhD student can efficiently program experiments fitting a technically optimal environment.

This is what this course is all about. It aims at teaching programming skills, which are needed to modify the existing templates such that they meet your own demands. Because this can be quite complex, we start with short assignments, which address one basic and simple problem at a time. They will all contribute to the final assignment in which you will work on an existing template.


Installing PsychoPy on Faculty of Social Sciences lab computers is done for you. Do not attempt to install it yourself or to make changes to an existing installation. Ask lab support for help if you need to do more than what is possible with the installed software. Lab support will make sure all monitor, sound card and interface settings are correct. Skip this installation section if you are using a lab computer.

If you have a computer maintained by ISC, you can select PsychoPy in the Application Catalog. cal

Instructions on how to install psychopy on your own computer can be found here.

If you want to use the Buttonbox or the red Joystick for your experiment, you also need to install the RuSocSci package.

Starting the software

Start the PsychoPy program using whatever way you usually start programs on your system.

Now the PsychoPy program will start. The window that we see is called the builder view.

We do not use the builder. Switch to coder view with ctrl-l or with View -> Open Coder view.

The coder view is really an editor in which you can write your experiment. There is a run button on top (the button with the running man). Press it to start your experiment. You can also use your own preferred programming environment (IDE/editor). You do not need to start the PsychoPy program to start your experiment. After saving the experiment you can start it by double clicking it in Windows Explorer, Mac OS Finder, KDE Dolphin, ...

Continue with the next lesson