Changing number of vertices of shape on each trial

I believe that this can’t be done. What I do is create separate polygon objects for each possibility and present the one I want.

shapes = []
#square
shapes.append(['square',[[.707,-.707],[-.707,-.707],[-.707,.707],[.707,.707]],' '])
#triangle
shapes.append(['triangle',[[.866,-.5],[-.866,-.5],[0,1]],' '])
#circle
shapes.append(['circle',[[0.000,0.866], [0.091,0.861], [0.180,0.847], [0.268,0.824], [0.352,0.791], [0.433,0.750], [0.509,0.701], [0.579,0.644], [0.644,0.579], [0.701,0.509], [0.750,0.433], [0.791,0.352], [0.824,0.268], [0.847,0.180], [0.861,0.091], [0.866,0.000], [0.861,-0.091], [0.847,-0.180], [0.824,-0.268], [0.791,-0.352], [0.750,-0.433], [0.701,-0.509], [0.644,-0.579], [0.579,-0.644], [0.509,-0.701], [0.433,-0.750], [0.352,-0.791], [0.268,-0.824], [0.180,-0.847], [0.091,-0.861], [0.000,-0.866], [-0.091,-0.861], [-0.180,-0.847], [-0.268,-0.824], [-0.352,-0.791], [-0.433,-0.750], [-0.509,-0.701], [-0.579,-0.644], [-0.644,-0.579], [-0.701,-0.509], [-0.750,-0.433], [-0.791,-0.352], [-0.824,-0.268], [-0.847,-0.180], [-0.861,-0.091], [-0.866,0.000], [-0.861,0.091], [-0.847,0.180], [-0.824,0.268], [-0.791,0.352], [-0.750,0.433], [-0.701,0.509], [-0.644,0.579], [-0.579,0.644], [-0.509,0.701], [-0.433,0.750], [-0.352,0.791], [-0.268,0.824], [-0.180,0.847], [-0.091,0.861]],' '])
if expInfo['expt'] != '15':
#diamond
    shapes.append(['diamond',[[1,0],[0,-1],[-1,0],[0,1]],' '])
#pentagon
    shapes.append(['pentagon',[[0,1],[.951,.309],[.588,-.809],[-.588,-.809],[-.951,.309]],' '])
#hexagon
#shapes.append(['hexagon',[[1,0],[.5,-.866],[-.5,-.866],[-1,0],[-.5,.866],[.5,.866]],' '])
#octagon
#shapes.append(['octagon',[[1,0],[.707,-.707],[0,-1],[-.707,-.707],[-1,0],[-.707,.707],[0,1],[.707,.707]],'n '])
#heptagon
    shapes.append(['heptagon',[[0,-1],[-.782,-.623],[-.975,.223],[-.434,.901],[.434,.901],[.975,.223],[.782,-.623]],' '])
#cross
#shapes.append(['cross',[[1,.25],[1,-.25],[.25,-.25],[.25,-1],[-.25,-1],[-.25,-.25],[-1,-.25],[-1,.25],[-.25,.25],[-.25,1],[.25,1],[.25,.25]],' '])
#parallelogram
    shapes.append(['parallelogram',[[1,.707],[.5,-.707],[-1,-.707],[-.5,.707]],' '])
#four pointed star
#shapes.append(['star',[[1,0],[.25,-.25],[0,-1],[-.25,-.25],[-1,0],[-.25,.25],[0,1],[.25,.25]],' '])
#trapezium
    shapes.append(['trapezium',[[.5,.707],[1,-.707],[-1,-.707],[-.5,.707]],' '])

shuffle(shapes)
showPic=-1
pic=[]
for Jdx in range(nPeople):
        pic.append(visual.ShapeStim(
        win=win,
        fillColor=white,
        lineColor=white,
        vertices=shapes[Jdx][1],
        pos = [0,0],
        size=.2
        ))