![]() ![]() Win.flip(clearBuffer=False)#redraw the bufferĮvent. GlobForm = visual.ElementArrayStim(win, nElements=N, units='pix',sizes=elemSize,fieldShape='sqr',fieldSize=(1024-elemSize,768-elemSize),sfs=0,elementMask='circle',xys=locations) #build an array of circles according to the parameters #To choose which stimuli to generate uncomment the appropriate line Numbers = range(100) #range of stimuli to be generated or how many to generate IVe included the code, sadly i didnt write this and no almost nothing about programming from psychopy import visual, core, misc, eventįrom numpy.random import random, shuffle #we only need these two commands from this lib Is there something different that mac uses in the python code then the pc? if not any other suggestions why it wouldnt be working Now the code wont work on the pc it tells me there a syntax error. Run the example in the terminal with the following command: python psychopy_stimulus_example.Ive recently tried to move a python code from a mac version to a version of Psychopy IDE. # Show the window (it should be empty, but we need it to record keyboard events) Copy-paste the following text and save it as “psychopy_keyboard_example.py”: # Import modules 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!') psyexp file) and use Coder to view and edit it (.py file). You can compile the code from Builder (a. Builder makes it easy to visualize the structure of your experiment, create trial loops, integrate code components, add keyboard responses, present visual stimuli, etc. # Refresh/update the window (with the fixation point drawn on) It is completely GUI driven and very user friendly. # 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. Does the images you are presenting have certain properties that you will assign them with different texts I am assuming no for the. ![]() Just a suggestion as I am also a newbie in PsychoPy. I don’t recommend beginners using PsychoPy on Windows. If you switch your code type to both, then you can use PsychoJS built-in shuffle function: imglist 1,2,3 util.shuffle(imglist) // shuffles in place. ![]() 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: 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. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |