GL.glTranslatef(self.posPix[0], self.posPix[1], 0)
IndexError: index 1 is out of bounds for axis 0 with size 1
Same result with $locs[0] instead of locs[0].
This suggests there’s something wrong with how psychopy reads the array or how variables are passed along. When I try the code in a python interpreter, print(locs[0]) works fine.
one way to select randomly from two positions is to create two lists, one your your x-coordinate, the other you your y-coordinate. Shuffle each and use those to create your position.
In the end I shuffled the text strings, not the positions.
targets = [target1,target2] # where target1,target2 are cols in the master csv
random.shuffle(targets)
target1b = targets[0] # wgere target1b,target2b are displayed by the two text elements
target2b = targets[1]
thisExp.addData("button1", targets[0])
thisExp.addData("button2", targets[1])