How to add a displacement modifier and source image with blender python I want to add a displacement modifier to the active object and set the source image in python when you press a button. How can I do this?
The code is

heightTex = bpy.data.textures.new('Texture name', type = 'IMAGE')
heightTex.image = bpy.data.images['Myimage.jpg']
dispMod = ob.modifiers.new("Displace", type='DISPLACE')
dispMod.texture = heightTex