hiltiowa.blogg.se

Visual task psychopy example code
Visual task psychopy example code








screenindexdisplay.getStimulusScreenIndex () Read the coordinate space the script author specified in the config file (right now only pix are supported) coordtypedisplay.getDispla圜oordinateType () Create a psychopy w. Run the example in the terminal with the following command: python psychopy_stimulus_example. screenresolution display.getStimulusScreenResolution () get the index of the screen to create the PsychoPy window in. # Show the window (it should be empty, but we need it to record keyboard events) presented near the end of Chapter 2 in the section Example: Directory Structure for the Book': Ch5.

visual task psychopy example code

Copy-paste the following text and save it as “psychopy_keyboard_example.py”: # Import modules Crafting Visual Transformation Scripts Shai Vaingast. Now we will run a simple keyboard example script. Then use the terminal to run the file with a command: python psychopy_stimulus_example.py # Show the window after drawing the stimulus Message = visual.TextStim(window, text='Stimulus!') # Refresh/update the window (with the fixation point drawn on) # Prepare a fixation point (we will draw it in the next step)įixation = visual.TextStim(window, text='+') Open some text editor, e.g., Gedit (on Ubuntu), paste and save the following text to a filename named, e.g.: “psychopy_stimulus_example.py”: # Import modules Windows is generally not Python friendly, and installing all dependencies and virtual environments can be harder for a beginner even than installing a dual-boot Linux or just getting some old PC and installing Lubuntu there. I don’t recommend beginners using PsychoPy on Windows.

VISUAL TASK PSYCHOPY EXAMPLE CODE INSTALL

Install PsychoPy: sudo pip install psychopy Open a terminal ( 5 Ways to Open a Terminal Console Window Using Ubuntu). Hence, I prepared this basic example featuring:

visual task psychopy example code

However, it seems that entry-level examples one can find in the web are rather sophisticated. PsychoPy is an excellent tool for preparing psychological experiments in Python.








Visual task psychopy example code