Track To on local axis

short question
does any1 know if it’s already possible somehow with python to use track to only on, let’s say, Z axis?

This can be done using the alignAxisToVect function of a game object, e.g:

# make an objects z axis point to an object
import bge

own = bge.logic.getCurrentController().owner
target = bge.logic.getCurrentScene().objects['target']

vect = target.worldPosition - own.worldPosition
own.alignAxisToVect(vect, 2, 1)