How to code properly?

Finaly I wrote my first addon with one button to add one light. And now I want to set some properties (copied from the info panel). But that gives code in the format like:, which is kind of relative and later Blender doesn’t understand where to is refered.

This is the part of the code:

def execute(self, context):
		bpy.ops.object.light_add(type='POINT', radius=1, view_align=False, location=(0, 0, 0))
		bpy.ops.transform.translate(value=(0, 0, 3.18139), orient_type='GLOBAL', orient_matrix=((1, 0, 0), (0, 1, 0), (0, 0, 1)), orient_matrix_type='GLOBAL', constraint_axis=(False, False, True), mirror=True, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1)
		return {"FINISHED"} = True = 0.5 = 0.2 = 0.09 = 1

Now how do I get the absolute adres of the light, and how do I code that?

Your “return” has to be at the end of the code.

@kkar, Yes I’ve seen it. but would that be enough?
I’ll check.

Update: yes, that works. Pffw, Eassier than I thought.