![]() Msg1 = visual.TextStim(win, text="press any key to start", color=white, colorSpace='hex') ![]() # Elements are only displayed after the flip command is executedīackground = visual.Rect(win, width=resolution+10, height=resolution+10, fillColor=gray, fillColorSpace='hex') Msg2 = visual.TextStim(win, text="press to continue", color=white, colorSpace='hex',alignHoriz='center', alignVert='center') ![]() Msg1 = visual.TextStim(win, text="press to exit", pos=(0.0,(-resolution*0.10)), color=white, colorSpace='hex') Our program has only two screens, the starter screen that ask you to start, and the stop screen that records how long you took to press the button.īackground = visual.Rect(win, width=resolution+10, height=resolution+10, fillColor=black, fillColorSpace='hex') Here we will specify the text messages, its style, the background colour and all that kind of things. Win = visual.Window(resolution,units="pix", color=gray, colorSpace='hex', fullscr=fullScreen, monitor = "testMonitor") In psychopy you define the window where all the screens are going to be displayed like this def window(resolution): Setting constants and global variables # Colours Import pandas as pd # Used to save the data as csv easily ![]() Import datetime # Used to register the date of the experiment The full code can be found here.įirst I import the libraries from psychopy import visual, core, event In this example I will show how to develop a basic experiment that registers how much time it takes for someone to press a key, then I will save the data as a csv file. Psychopy library is a useful framework to develop psychological experiments using Python. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |