Move lattice points with Python?

Is there a way to move the points of a lattice with a script? I see a way to access their locations, but not a way to move them.

Use lattice.points[index].co_deform = Vector((x, y, z)).

Oh, I just saw this, thanks for replying, though it says the object does not have a “points” attribute.

The “Object” is just a container. The ‘real’ lattice object is located inside the object at object.data.
The complete line of code would be:

bpy.data.objects['your_lattice_obj'].data.points[index].co_deform = Vector((x, y, z))

or, if you want to access the ‘Lattice’ directly:

bpy.data.lattices['your_lattice_data'].points[index].co_deform = Vector((x, y, z))

That works. Thank you very much!