I can add an object to a scene, and apply a Displace modifier to it using the following code:
bpy.ops.mesh.primitive_cube_add()
bpy.ops.object.modifier_add(type='DISPLACE')
It's also easy to change some of the Modifiers attributes, like so:
bpy.context.object.modifiers["Displace"].strength = 1
However, I'm not sure how to link a texture to the modifier via Python. Tried the following code:
bpy.context.object.modifiers["Displace"].texture = 'Tex'
But it gives this error:
TypeError: bpy_struct: item.attr = val: DisplaceModifier.texture expected a Texture type, not str
Linking a texture to the modifier manually shows nothing in the Info window, so I'm not sure how to accomplish this using Python.