You are here

Building Experiments in PsychoPy

Building Experiments in PsychoPy

May 2018 | 312 pages | SAGE Publications Ltd

PsychoPy is an open-source (free) software package for creating rich, dynamic experiments for psychology, neuroscience, and linguistics. It provides an intuitive graphical interface (the ‘Builder’) as well as the option to insert Python code. This combination makes it easy for teaching, but also flexible enough for all manner of behavioural experiments. Divided into three parts, this textbook is suitable for teaching practical undergraduate classes on research methods, or as a reference text for the professional scientist.

The book is written by Jonathan Peirce, the original creator of PsychoPy and Michael MacAskill, and they utilise their breadth of experience in Python development to educate students and researchers in this intuitive, yet powerful, experiment generation package.

Chapter 1: Introduction
Section 1: For the beginner
Chapter 2: Building your first experiment
Chapter 3: Using images - a study into face perception
Chapter 4: Timing and brief stimuli: Posner cueing
Chapter 5: Creating dynamic stimuli (revealing text and moving stimuli)
Chapter 6: Providing feedback: simple Code Components
Chapter 7: Ratings: Measure the Big 5 personality constructs
Chapter 8: Randomization, blocks and counterbalancing: a bilingual
Chapter 9: Using the mouse for input: creating a visual search task li
Section 2: For the professional
Chapter 10: Implementing research designs with randomization
Chapter 11: Coordinates and color spaces
Chapter 12: Understanding your computer timing issues
Chapter 13: Monitors and Monitor Center
Chapter 14: Debugging Your Experiment
Chapter 15: Pro-tips, tricks, and lesser-known features
Section 3: For the specialist
Chapter 16: Psychophysics, stimuli and staircases
Chapter 17: Building an fMRI study
Chapter 18: Building an EEG study
Chapter 19: Add eye-tracking to your experiment
A: Mathematics refresher
B: Exercise solutions

This friendly and comprehensive book should be required reading for any student planning a psychology/neuroscience experiment. It provides a friendly introduction for the non-programmer as well as a handy reference guide for the more advanced user. Your students will thank you for recommending it. Make sure that your library has it in stock.

Dr Joseph L Brooks
Senior Lecturer, School of Psychology, Keele University

Python is quickly becoming the programming language of choice in psychology and one very useful toolbox for designing and implementing experiments is PsychoPy. The PsychoPy Builder, in combination with this book, provides a smooth transition into the fine art of writing experiment code. This book is written by vision scientists, and it shows.

Tom Verguts
Department of Experimental Psychology, Ghent University

An essential read for anyone starting out creating computer-based experiments using PsychoPy.  As an open source project, PsychoPy has evolved far beyond its original purpose, to the point where it can now interact with a variety of different hardware devices (e.g., eye-trackers, button boxes) and produce online web-based experiments. So, the time is ripe for a manual that gently guides the reader through from beginner to professional and ultimately to discovering the specialist applications of PsychoPy.

Jonathan Brooks
Clinical Research and Imaging Centre, University of Bristol, UK

Including a variety of real-word examples and step-by-step screenshots for beginners with further sections for professionals, this a resource essential reading for anyone wanting to use it for serious research.

John Allen
School of Psychology, University of Kent

This book fills an incredibly important gap in the field. Many users of PsychoPy will be excited to learn that there is now a highly accessible and well-designed written guide to refine their skills. No more tinkering with the templates of other people’s scripts (unless you want to, of course). The book provides clear instructions on how to build computerized experiments from scratch to the exact specifications you want.

Having previously taught PsychoPy to university students, I am also convinced that the book will soon turn into one of their most cherished learning companions. In particular, its dedicated ‘Warning’ sections provide extremely handy reminders what to look out for when a script does not seem to do what it was meant to do. In fact, within 30 min of reading the book, I spotted a problem I currently had with one of my own scripts (the typical ‘duh!’ moment).

Equally handy are the book’s chapters that outline how to make PsychoPy ‘speak’ to external devices, ranging from eye-trackers to fMRI scanners. They provide invaluable information about all the nitty-gritty details that should be considered under such circumstances. In consequence, the book really helps with handling any unnecessary panic that can set in when setting up a new experiment.

The only thing that can be criticized about this book is that it was not published any earlier. I am a bit envious of the generations of new users that can simply look up ‘loop ordering options’ or ‘non-slip timing’.

Susanne Quadflieg, Senior Lecturer in Social Psychology,
University of Bristol

This book offers a great start into building your own experiments. The examples and hands-on exercises (with increasing difficulty) facilitate the learning process and the book furthermore offers an outlook and tips on more complicated topics. So it’s not only useful for the first programming steps but also in later stages of experimental design. The book is continuously written for novices in programming, which makes the start of programming less frustrating. I also like the additional tips on how to calibrate the hardware/equipment so that an optimal communication between software and hardware is obtained.

Dr Katharina Limbach
Psychology, Technical University of Dortmund
April 17, 2019

Excellent book. Within the course, there are four specializations (one for experimental design). I will use it within that specialization.

Dr Sebastian Jentschke
Psychology, Bergen University
July 4, 2019

This is an outstanding book in that it introduces PsychoPy in a way that is comprehensible and accessible to students (and professionals) who do not have previous programming experience. It provides a structure that a student could follow, and it uses examples (Stroop task, personality construct measurement) that are simple and should be known by all students reaching the point where they take an experimental project-based course. Despite the wealth of information and tutorials available online for free, for an instructor, assigning chapters in a textbook in a stepwise fashion is still one of the most reliable ways of ensuring that the students follow a pedagogical plan and do not get distracted or drowned in a sea of what for many, especially in humanistic education programs, is outright scary material (programming).

Dr Nikita Kharlamov
Department of Communication & Psychology, Aalborg University
February 24, 2019

For those that are interested in an open source solution for building experiments, this book is a 'must have'. Very comprehensive in its content, this book provides a good starting point for beginners.
I can recommend this book to all students and professionals in the field of experimental psychology. Next to the book you will receive links on additional material to start working.

Dr Carsten Moeller
Institute of Communication and Media Research, DSH - German Sport University
November 28, 2018

This book is a esential reading for anyone wanting to use open-source software for experimental design in Psychology. It's written in a very comprehensive and readable style and includes step-by-step guides for designing real experiments for both beginners and professionals. If it would have been published years ago, I would have designed my experiments in PsychoPy! Highly recommended.

Dr Luis Morales
Psychology, Universidad Loyola Andalucía
November 7, 2018
Key features
  • Co-written by Jonathan Peirce, the original creator of PsychoPy.
  • Jonathan Peirce runs a support section of his website and has PsychoPy tutorials available on YouTube.
  • The final three chapters concentrate on methods in cognitive psychology—an area of psychology where this kind of software is most commonly used.