Hello, consider yourself warned - I’m a total newbie at this stuff, but hey everyone has to start at someplace.
I have a pair of videos that I want to counterbalance - I did so with vidPositions = [(-300,0),(300,0)] (the coordinates are the positions of the video) and then shuffle(vidPositions) for every trial. This produced the problem of the first video showing first on either the left or right side of the screen, when I would have liked the first video to always be on the left side of the screen, despite its being counterbalanced. Here’s my code:
vidPositions = [(-300,0),(300,0)]
# ------Prepare to start Routine "trial"-------
# update component parameters for each repeat
shuffle(vidPositions)
print(type(vidPositions[0]))
if vidPositions[0] = '(-300,0)':
leftvideo = visual.MovieStim3(
win=win, name='leftvideo',
noAudio = True,
filename=video1,
ori=0, pos=vidPositions[0], opacity=1,
loop=False,
size=(640,360),
depth=0.0,
)
rightvideo = visual.MovieStim3(
win=win, name='rightvideo',
noAudio = True,
filename=video2,
ori=0, pos=vidPositions[1], opacity=1,
loop=False,
size=(640,360),
depth=-1.0,
)
else: rightvideo = visual.MovieStim3(
win=win, name='rightvideo',
noAudio = True,
filename=video2,
ori=0, pos=vidPositions[1], opacity=1,
loop=False,
size=(640,360),
depth=-1.0,
)
leftvideo = visual.MovieStim3(
win=win, name='leftvideo',
noAudio = True,
filename=video1,
ori=0, pos=vidPositions[0], opacity=1,
loop=False,
size=(640,360),
depth=0.0,
)
I keep getting the error that vidPositions[0] in the if loop is invalid syntax. I’ve tried quotations, single quotes, but nothing avails. What can fix this?