Print spotlamp direction in console

Hi, I’ve been using code such as:

size = obj.data.spot_size
print(size)
blend = obj.data.spot_blend
print(blend)

to print spotlamp variables to the console.

How can I get the vec3 direction of the spotlamp?
A point along the direction in which it faces would be fine too since I can use the location of the lamp, subtract and normalize.

Try this:

import bpy
from mathutils import Vector

ob = bpy.data.objects['Lamp']

v = Vector((0,0,-1))
v.rotate(ob.rotation_euler)
print(v)


Thank you! Works perfectly.