Camera using console

Hi all,
I am currently working on creating an animation showing segmentation results of my lab. These results are saved as .stl surfaces. My aim is to create a script that will import the 1000 surfaces as well as creating a camera and a bezier circle or curve on which the camera moves along.
I am currently stuck with the camera creation

For my purpose I need to increase the value of clip_end to a very high number. As far as I know I also have to be able to select the camera using something like camera.select=True in order to let it follow the path of a bezier circle (bpy.ops.object.parent_set(type=‘FOLLOW’, xmirror=False, keep_transform=False)). I also need to define a camera location and a constraint whih lets it ‘look’ at an empty. Using the GUI I have no problem of setting all these parameters but neither the Info window nor the API provide enough information for me to do this. I tried

camera=bpy.data.cameras.new(‘Camera’) as well as
camera2=bpy.data.objects.new(‘Camera’, camera)

to do this but both do not suit my needs. Is there anything i misunderstood?
Thank you for your help!

camera and constraint



 
def addTrackToConstraint(ob, name, target):
 
 cns = ob.constraints.new('TRACK_TO')
 cns.name = name
 cns.target = target
 cns.track_axis = 'TRACK_NEGATIVE_Z'
 cns.up_axis = 'UP_Y'
 cns.owner_space = 'WORLD'
 cns.target_space = 'WORLD'
 
 return
 
 

addTrackToConstraint(lamp1,‘AutoTrack’,empty1)

so add or use an existing camera then call the constraint

then the camera will follow the empty constraint

should work

salutations