I am trying an experiment in Psychopy for randomising the posisitton of some object in one image.
I have the codes.
I am using a code component at the begin experiment tab:
import random, xlrd #randomize seed random.seed() #input file in_file = 'MyFile.xlsx' #number of items to load num_items = 8 #counters to hold the next stimulus reference cur_image = 0 cur_position = 0
at the begin routine:
#open the excel file inbook = xlrd.open_workbook(in_file) insheet = inbook.sheet_by_index(0) #arrays to hold our stimuli image_stim =  position_stim =  #loop through the rows in the stimulus file for rowx in range(1, num_items+1): #reed in an entire row row= insheet.row_values(rowx) #save the images and positions image_stim.push(row) position_stim.push(row) #randomly shuffle the images random.shuffle(image_stim) #randomly shuffle the colors random.shuffle(position_stim)
I have an Excel file which contains everything else for the position.
I tried everything that I found in the forum and other forums nothing works. Even the new version with the codes but I still get the same error. Any help would be appreciated.