I am using psychopy builder and created a code section to have a progress bar, but I can't seem to simplify the code, so that when the progress bar expands, I dont have to keep writing the same code over...

In Begin Experiment I have:

ProgVertices = [[-.5,0],[-.5,.5][-.2,.5],[-.2,0]]

counter = 0

Test1 = visual.ShapeStim(win, lineColor = 'green', vertices = ProgVertices, pos = (0,0), autoDraw = True))

In Each Frame tab I have:

if counter < 10:

    core.wait(1)

    counter = counter +1

if counter >= 6:

   ProgVertices[2] = [0.5,0.5]

   ProgVertices[3] = [0.5,0]

  Test1 = visual.ShapeStim(win, lineColor = 'green', vertices = ProgVertices,    pos = (0,0), autoDraw = True))

This works but I feel like its redundant code if I wanted to update the counter a little every second (as opposed to just at 6 seconds). Any help to simplify the code would be appreciated!

Thanks

More Shai Porat's questions See All
Similar questions and discussions