Trouble selecting and extruding specific polygons (python)
seems vert and edge selection was being extruded too, so they needed to be cleared with bpy.ops.mesh.select_all(action='DESELECT'), and mode_set flips to update mesh's selection, and then extrusion result: 

def Extrude(box,S,c1,c2):
    epsilon = 1e-04
    mesh = box.data
    polygons = mesh.polygons
    for c in [c1,c2]:
        for i in [0,1,2]:
            sa=[]
            pci=None
            bpy.ops.object.mode_set(mode = 'EDIT')
            bpy.ops.mesh.select_mode( type  = 'FACE'   )
            bpy.ops.mesh.select_all(action='DESELECT')
            bpy.ops.object.mode_set(mode = 'OBJECT')
            for p in polygons:
                pci_=p.center[i]
                s = abs(pci_-c[i]) &lt; epsilon
                if s: pci=pci_
                p.select = s
                sa.append(s)
            si = -1. if c[i]&lt;0. else 1. if c[i]&gt;0. else 0.
            d = [0,0,0]
            d[i] = ( (S/2-abs(c[i])) - abs(pci) ) * si
            bpy.ops.object.mode_set(mode = 'EDIT')
            bpy.ops.mesh.extrude_region_move(TRANSFORM_OT_translate={"value": d})
    #bpy.ops.object.mode_set(mode = 'OBJECT')
Extrude(box,S,c1,c2)```