1.1 Introducing the Pyschopy2 Console
Install PsychoPy3
In case you haven't installed the software yet, here is a quick tutorial on how to do it:
Step 1. Go to http://psychopy.org/installation.html and download the most recent standalone version for your operating system.
Step 2. Run the PsychoPy installation you just downloaded.
Step 3. You are now ready to start working in Psychopy. Run the PsychoPy3 program that should now be on your computer.
The Console
Now that you have downloaded the program, we can have a look at the PsychoPy3 interface. First time you open PsychoPy it opens both the Builder window and the Coder window. We will only be using the coder window so you can simply close the Builder one. The coder window looks something like Figure 1.1 below.
Figure 1.1: The PsychoPy3 interface.
The big grey window is the editor window. To start programming in it, click on the new page button to the top left. The white bottom window of the interface (also called the Shelf) consists of the has two tabs: the Output and the Shell. The Output window presents you with the output from the script editor. If you click on the Shell tab, you are presented with the console window. Here you can type commands and get instant output.
We will be focusing on the main editor and the output windows for the tutorial. We can think about the editor window as a giant calculator. We can type in individual lines of code and execute them all together. The code can be saved and run at a later point in time if you please. It can be edited and rerun. So don't worry if you make a mistake, just go back and correct it!
Libraries
PsychoPy3 uses various libraries that need to be imported in order for certain features and functions within the program to work. For example the library called visual imports a module for visual presentation, and the module pandas can be used to write a .csv log file in PsychoPy3.
Libraries usually need to be imported at the top of the Python script in order to ensure it works on all the code below it. An example of how to import the libraries visual and pandas is shown below.
from psychopy import visual
import pandas as pd
Throughout the tutorial we will provide you with the specific libraries needed for the tasks we present.