How to point a sun lamp using a vector in Python? It seems this should be easy - I have a long list of normals as a list of tuples in my python script.

[(nx, ny, nz), (nx, ny, nz), (nx, ny, nz)...]


Each tuple represents the direction I want a sun lamp to point for that particular frame of animation.

How do I set the direction of a sun lamp using a vector? 

Is there a straightforward python method - maybe in mathutils - that would set sun lamp's matrix so that it points in the direction of the vector?  

I've looked there but nothing stands out as far as I can see, though I'm a mathutils noob.

No nodes or plugins, thanks!
There is indeed a straightforward python method using mathutils.

from mathutils import Vector
direction = Vector(your_tuple)
your_object.rotation_mode = 'QUATERNION'
your_object.rotation_quaternion = direction.to_track_quat('Z','Y')


You can see the doc here for more details.

Edit: As the sun direction is negative on the z axis, you may have to change 'Z' to '-Z'