import maya.cmds as mc object = mc.ls(selection =True)[0] keys = mc.keyframe(object, query =True) i = 0 while i < len(keys): mc.selectKey(object, k =True, time = (keys[i], keys[i]), add =True) i = i+2 print "Selected " + str(len(keys[::2])) + " keys: ", str(keys[::2])