It looks like it would be easy to add a texture to a material using Python, but no matter what i do i cant figure it out!
I can create a texture using:
bpy.data.textures.new("NewTexture", type='IMAGE')
and I can create a new material texture slot:
bpy.context.object.active_material.texture_slots.add()
However i can't link the texture to the Material Slot Texture. I have tried looking through the python API but nothing is working. I would be eternal grateful if someone could point me in the right direction.