I was an absolute beginner. Now I am a beginner. The difference is that I am now familiar with the functions in the builder view, but not proficient in python.

So most of the time I rely on the builder view to design the basic framework of the experiment, and use the code component to make minimal customization (e.g. randomize the stimuli, add pause function, etc.).

Here are some good practices I learned in the past two years. I posted them here as a reminder to myself. I’ll add more in the future.

  1. While trying out your experiment, do not use full-screen. In case the screen freezes, you can still “force-quit” .
  2.  While doing programming in the coder view, don’t name your .py file in the same way as some of the python libraries. I once named my file random.py, the program stopped working, because “random.py” is one of the python libraries used by psychopy. So if you see warnings like “cannot find xxx function in random” or “cannot find xxx function in visual”, chances are you named some of your own files as random.py or visual.py.
  3. Always make sure that different computers are using the same version of psychopy. Psychopy gets updated quite frequently. Different versions of psychopy usually have different functionalities. So if you need to make your experiment available on more than one computers, please make sure that those computers are running the same version of psychopy.
  4. If you are using codes in the builder view to adjust time or condition, make sure you correctly choose “time”, or “condition”. Usually, we will have several components in one routine. Sometimes we need one component to show after another, rather than showing all the components simultaneously. For example, if you want a component (say a text component) to appear after a sound component in a loop. You can set the starting CONDITION of the text component as “sound_1.getDuration()”. The trick is we need to first change “start: time” to “start: condition”.
Advertisements