How do I change the DoF settings of the active camera using python?
bpy.context.scene.camera returns the active camera in the scene. In order to change your Depth of Field settings use the Console, Python Tooltips or the API to find each corresponding property.

&gt;&gt;&gt; active_cam = bpy.context.scene.camera
&gt;&gt;&gt; bpy.data.cameras[active_cam.name].
                                      angle
                                      angle_x
                                      angle_y
                                      dof_distance
                                      dof_object
                                      ...
&gt;&gt;&gt; bpy.data.cameras[active_cam.name].dof_distance = 7