![]() # update/draw components on each frame # *textWelcome* updates ThisComponent.status = NOT_STARTED -Start Routine “welcome_screen”-įrameN = frameN 1 # number of completed frames (so 0 is the first frame) Welcome_screenComponents = įor thisComponent in welcome_screenComponents: KeyWelcome = event.BuilderKeyResponse() keep track of which components have finished RoutineTimer = core.CountdownTimer() # to track time remaining of each (non-slip) routine -Prepare to start Routine “welcome_screen”-ĬontinueRoutine = True update component parameters for each repeat GlobalClock = core.Clock() # to track the time since experiment started Text=‘Welcome please read the instructions’, ![]() TextWelcome = visual.TextStim(win=win, name=‘textWelcome’, Units=‘height’) store frame rate of monitor if we can measure itĮxpInfo = win.getActualFrameRate()įrameDur = 1.0 / round(expInfo)įrameDur = 1.0 / 60.0 # could not measure, so guess Initialize components for Routine “welcome_screen” Monitor=‘testMonitor’, color=, colorSpace=‘rgb’, (logging.WARNING) # this outputs to the screen, not a fileĮndExpNow = False # flag for ‘escape’ or other condition => quit the exp Start Code - component code to be run before the window creation Setup the Window LogFile = logging.LogFile(filename ’.log’, level=logging.EXP) OriginPath=‘C:\Users\Li\Desktop\Python_Exercises\demo1_lastrun.py’,ĭataFileName=filename) save a log file for detail verbose info ThisExp = data.ExperimentHandler(name=expName, version=’’, log, etcįilename = thisDir os.sep u’data/%s%s_%s’ % (expInfo, expName, expInfo) An ExperimentHandler isn’t essential but helps with data saving Os.chdir(_thisDir) Store info about the experiment sessionĮxpName = ‘demo1’ # from the Builder filename that created this scriptĮxpInfo = ĭlg = gui.DlgFromDict(dictionary=expInfo, title=expName)ĮxpInfo = data.getDateStr() # add a simple timestampĮxpInfo = psychopyVersion Data file name stem = absolute path name later add. _thisDir = os.path.dirname(os.path.abspath( file)) Import sys # to get file system encoding Ensure that relative paths start from the same directory as this script Import os # handy system and path functions Sqrt, std, deg2rad, rad2deg, linspace, asarray)įrom numpy.random import random, randint, normal, shuffle Import numpy as np # whole numpy lib is available, prepend ‘np.’įrom numpy import (sin, cos, tan, log, log10, pi, average, STOPPED, FINISHED, PRESSED, RELEASED, FOREVER) doi: 10.3389/neuro.11.010.2008įrom future import absolute_import, divisionįrom psychopy import locale_setup, sound, gui, visual, core, data, event, logging, clockįrom nstants import (NOT_STARTED, STARTED, PLAYING, PAUSED, Peirce, JW (2009) Generating stimuli for neuroscience using PsychoPy.įrontiers in Neuroinformatics, 2:10. ![]() Journal of Neuroscience Methods, 162(1-2), 8-13. Peirce, JW (2007) PsychoPy - Psychophysics software in Python. If you publish work using this script please cite the PsychoPy publications: ![]() This experiment was created using PsychoP圓 Experiment Builder (v3.0.5), ![]() I tried a simple builder experiment and when I run nothing happens, so I tried to run in tried to run in the equivalent coder of the builder experiment which is: ![]()
0 Comments
Leave a Reply. |