Abstract
Expyriment is an open-source and platform-independent lightweight Python library for designing and conducting timing-critical behavioral and neuroimaging experiments. The major goal is to provide a well-structured Python library for script-based experiment development, with a high priority being the readability of the resulting program code. Expyriment has been tested extensively under Linux and Windows and is an all-in-one solution, as it handles stimulus presentation, the recording of input/output events, communication with other devices, and the collection and preprocessing of data. Furthermore, it offers a hierarchical design structure, which allows for an intuitive transition from the experimental design to a running program. It is therefore also suited for students, as well as for experimental psychologists and neuroscientists with little programming experience.
This is a preview of subscription content, access via your institution.



Notes
- 1.
www.debian.org. For the use of GNU/Linux in the field of neuroscience, see Hanke and Halchenko (2011).
- 2.
- 3.
- 4.
Note that each Expyriment stimulus can be integrated into the design hierarchy as well, using the
method.
- 5.
References
Bassi, S. (2007). A primer on Python for life science researchers. PLoS Computational Biology, 3, e199.
Brainard, D. H. (1997). The Psychophysics Toolbox. Spatial Vision, 10, 433–436. doi:10.1163/156856897X00357
Free Software Foundation. (2007). GNU General Public Licence. Retrieved from www.gnu.org/copyleft/gpl.html
Halchenko, Y. O., & Hanke, M. (2012). Open is not enough. Let’s take the next step: An integrated, community-driven computing platform for neuroscience. Frontiers in Neuroinformatics, 6, 22. doi:10.3389/fninf.2012.00022
Hanke, M., & Halchenko, Y. O. (2011). Neuroscience runs on GNU/Linux. Frontiers in Neuroinformatics, 5, 8. doi:10.3389/fninf.2011.00008
Hommel, B. (1993). Inverting the Simon effect by intention: Determinants of direction and extent of effects of irrelevant spatial information. Psychological Research, 55, 270–279. doi:10.1007/BF00419687
Jones, E., Oliphant, T. E., Peterson, P., et al. (2001). SciPy: Open source scientific tools for Python [Computer software]. Retrieved from www.scipy.org
Mathôt, S., Schreij, D., & Theeuwes, J. (2012). OpenSesame: An open-source, graphical experiment builder for the social sciences. Behavior Research Methods, 44, 314–324. doi:10.3758/s13428-011-0168-7
Oliphant, T. E. (2006). Guide to NumPy. Trelgol Publishing.
Peirce, J. W. (2007). PsychoPy: Psychophysics software in Python. Journal of Neuroscience Methods, 162, 8–13.
PyOpenGL. (2012). [Computer software]. Retrieved from http://pyopengl.sourceforge.net
PySerial. (2012). [Computer software]. Retrieved from http://pyserial.sourceforge.net
R Development Core Team. (2012). R: A language and environment for statistical computing. Vienna, Austria: R Foundation for Statistical Computing. Retrieved from www.R-project.org
Shinners, P. (2012). Pygame [Computer software]. Retrieved from www.pygame.org
Stahl, C. (2006). Software for generating psychological experiments. Experimental Psychology, 53, 218–232.
Straw, A. D. (2008). Vision Egg: An open-source library for realtime visual stimulus generation. Frontiers in Neuroinformatics, 2(4), 1–10. doi:10.3389/neuro.11.004.2008
Van Rossum, G., & Drake, F. L. (2011). Python language reference manual. Bristol, UK: Network Theory Ltd.
Acknowledgments
We thank Pascal de Water for great technical support, Sebastiaan Mathôt for his code evaluation and for choosing Expyriment as the default back end of OpenSesame 0.27, as well as dozens of students and colleagues for using old preliminary versions of Expyriment for their studies. Without their feedback, Exypriment would not have reached the level of a stable and reliable experiment programming library.
Author information
Affiliations
Corresponding author
Appendix
Appendix
Programming code for a response time experiment to assess a spatial stimulus–response compatibility effect (the Simon effect; Hommel, 1993)
Rights and permissions
About this article
Cite this article
Krause, F., Lindemann, O. Expyriment: A Python library for cognitive and neuroscientific experiments. Behav Res 46, 416–428 (2014). https://doi.org/10.3758/s13428-013-0390-6
Published:
Issue Date:
Keywords
- Software
- Programming library
- Python
- Experimental design
- Stimulus presentation