Running experiments in Python#
After spending quite a good while on important prerequisites concerning scientific computing and the basics of the python
programming language, it’s finally time to combine them via transitioning to more applied topics. This adventure will start with a brief exploration of how to create and run experiments using PsychoPy, a python library
dedicated to conducting experiments in the realm of psychology
and adjacent fields. Due to time constraints we will only have a quick look at things and showcase the most important aspects to allow folks to explore things further after the course ends. We’ll further concentrate on using psychopy to further your understanding of the Python essential such as control-flow statements.
Introduction to PsychoPy - I#
Most of us already conducted or at watched or help conduct an experiment. However, there’s a fair number of different software options and tools out there, which mostly depends on the computational infrastructure at hand, but also on what people have the experience and skills to master.
That being said: We’ll quickly discuss some tools to conduct experiments and work out if we can actually use python
based resources in this context with a clear conscience or if you’re better off by defaulting to paid software packages.
To get some idea on how to present experiments via Python, we will explore the python library
PsychoPy, including its setup, basic working principles, as well as advantages and disadvantages, showcased on a very simple experiment. Buckle up y’all, this is the first time we will use python
“in the wild”.
Materials đź““#
You can download the slides for todays session here
Afterwards, you will go through a tutorial by yourself, implementing the presented trial sequence. For the tutorial you need to download this folder. It contains all the materials you will need.
Homework assignment #6#
Your sixth and last homework assignment will entail the generation of a “new” psychopy experiment. You can use the tutorial as a starting point.
It should include
a trial sequence where some stimulus is presented and a response is collected.
this sequence should be repeated multiple times with varying conditions.
it should run without crashing and generate an output file.
bonus: it should have a dialogue box where partcipants can input e.g., id, age, handedness etc. which will be written to the output file
bonus 2: the output file should automatically be named after the participant id
Save it as a .py file and e-mail it to kallmayer[ at ]psych.uni-frankfurt.de
Deadline is TWO weeks from now