For some users the double slash "//" works, for others the "\" single backslash works. Note: Sometimes the paths don't work and you have to play around with the brackets.
Notice that the path to your image is put in between quotation marks.
Once you have made a dedicated directory for your stimulus images, you can create a variable called path and give it the name of the subdirectory, that is, the path relative to your script file. You could also have you image files I the same directory as your psychopy script, but if you have many files that can become a mess. To keep things tidy, the recommendation is to create a subdirectory in the same directory where your psychopy script is saved. from psychopy import visual, eventįirst, it is important to tell psychopy where to look for our image files. Note that we are not importing the glob module from psychopy, we are directly importing it from python. However the images we will be using are saved somewhere in our computer, so we will also need a module for retrieving files from a directory. For now we will import the visual module and the event module from psychopy. To start enabling Python to work with an image, we must first import the right modules.
#Psychopy window how to#
This section will focus on teaching you how to insert images within your experiment screen, and how to manipulate their size and location on the screen. For example an experiment where participants have to evaluate emotion on images. Every now and then you will need to create experiments in PsychoP圓 that show images to the participants.