Extracted from the following page https://blender.stackexchange.com/questions/13905/add-driver-for-a-shapekey-via-python
import bpy
obj = bpy.context.active_object
driver = obj.data.shape_keys.key_blocks['Key 1'].driver_add("value")
Personal notes
Recommended Posts