Skip to main content

Building Experiments with PsychoPy

  • Chapter
  • First Online:
Eye-Tracking with Python and Pylink

Abstract

PsychoPy is a very popular tool among psychologists. It can be installed as a Python module, but you can also use it as a standalone application that features a graphical user interface. PsychoPy offers a set of convenient functions for generating visual stimuli, registering keyboard and mouse events, and interfacing with research equipment. This chapter will first give an overview of the essential PsychoPy features that are frequently used for building experiments, most notably the various visual stimuli one can generate with PsychoPy and keyboard and mouse events handling. At the end of this chapter, we put together the building blocks of PsychoPy to create a simple script to illustrate the famous Simon effect.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

eBook
USD 16.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 16.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 129.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Modern video graphics cards all support hardware double buffering. At any time, the contents in the front buffer are actively being displayed on the screen, while the back buffer is being drawn. When the drawing is complete in the back buffer, the two buffers can be switched (flipped) so the back buffer becomes the front buffer and its content is shown on screen, usually in sync with the monitor vertical blanking signal.

  2. 2.

    http://www.cogsci.nl/blog/tutorials/211-a-bit-about-patches-textures-and-masks-in-psychopy.

  3. 3.

    PsychoPy allows users to instantiate multiple clocks to keep track of time for different purposes, e.g., a global clock to keep track of the amount of time elapsed since task onset and another clock to calculate response time on each trial.

Reference

  • C.H. Lu, R.W. Proctor, The influence of irrelevant location information on performance—A review of the Simon and spatial Stroop effects. Psychon. Bull. Rev. 2(2), 174–207 (1995)

    Article  Google Scholar 

  • Peirce, J., Gray, J. R., Simpson, S., MacAskill, M., Höchenberger, R., Sogo, H., Kastman, E., et al. (2019). PsychoPy2: Experiments in behavior made easy. Behavior Research Methods, 51(1), 195–203. doi:10.3758/s13428-018-01193-y

    Google Scholar 

  • Peirce, J., & MacAskill, M. (2018). Building Experiments in PsychoPy. SAGE

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2021 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Wang, Z. (2021). Building Experiments with PsychoPy. In: Eye-Tracking with Python and Pylink. Springer, Cham. https://doi.org/10.1007/978-3-030-82635-2_2

Download citation

Publish with us

Policies and ethics