import bpy bpy.context.object.data.sensor_width = 23.1 bpy.context.object.data.sensor_height = 15.4 bpy.context.object.data.sensor_fit = 'HORIZONTAL'