How can I change spline vertex weights?

How can I change the weight (“W:”) value of a spline control point via Python?


Many thanks for any help!

import bpy

for p in bpy.data.objects["NurbsCurve"].data.splines[0].points:
     p.weight = 0