Hero image

Vision and Haptics Laboratory: PsychoPy Demos


The aim of these demos is to provide an introduction to how to program using PsychoPy. To get started you will have needed to have downloaded the standalone PsychoPy application or downloaded a Python distribution and installed PsychoPy and its dependancies.

We will be showing you how to code in PsychoPy, not how to use the "drag and drop" style "bulider" interface. Thus, we reccommend installing a Python distribution and code editor, rather than using the standalone application. This offers far more flexibility and utility, and is far more relevent a skill to real-world programming. We reccommend the Anaconda  Python distribution and Visual Studio Code. Details of installing PsychoPy can be found here.

These demos are based upon the highly popular and widely used Psychtoolbox Demos which have been developed by the lab over many years. We are in the process of making a comparable resoure for PsychoPy. Thus, this is very much a work in progress as it will take quite some time to translate the 80+ Psychtoolbox Demos into Python and PsychoPy. 

The Psychtoolbox demos have been translated by Max Sargent and Peter Scarfe. There are many differences between Psychtoolbox and PsychoPy. As such, in places a direct translation is not possible, very difficult, or simply not at all sensible due to differences in the systems. 

Please note that the demos are currently under heavy deveopment, so should be considered alpha at best for now. 

(1) The Basics

The aim of the tutorials is to assume no prior experiance of programming with PsychoPy. As such, this first set of demos starts with the complete basics to introduce you to the core principles that constitute the foundations for all that follows. If you look at the later demos you will see that virtually all of the core code is shared with these early demos. Therefore, if you have never programmed with PsyhoPy, start here. 


Under construction


(2) Basic shapes and dots

This set of demos will show you how to draw static shapes, lines and dots. Much of the code in these demos shows the core functionality of drawing to the screen with PsychoPy so will be a valuable start-point for understanding the material covered in latter demos.


Under construction

(3) Animate basic shapes and dots

Now we have mastered drawing static stimuli to the screen, we will learn how to animate these shapes. Essentially this will allow us to translate, rotate expand and shrink objects drawn to the screen. We will also learn how to change the colour and size of objects contingent upon their movement. And finally, also learn how to interact with objects on the screen with the mouse or keyboard.


Under construction

Instagram image Instagram image Instagram image Instagram image Instagram image Instagram image