How to render turntable of .obj file I am new to blender. I have a .obj file that I need a rendered turntable of (meaning I need to spin the obj and render a frame every 10 degrees or so). Importing the .obj file works fine. However, I cannot even add a camera to the scene. I am trying this:

cam = bpy.data.cameras.new("Camera")
cam_ob = bpy.data.objects.new("Camera", cam)
bpy.context.scene.objects.link(cam_ob)
bpy.context.scene.objects.active = bpy.context.scene.objects["Camera"]


I also tried this:

bpy.ops.object.camera_add(view_align=False, enter_editmode=False, location=(0.0, 0.0, -4.0), rotation=(0.0, 0.0, 0.0))


but when I run

bpy.ops.render.render()


It says 

ERROR: Cannot render, no camera


What's the correct way of doing this, and what's the best way of repeatedly rendering the .obj while spinning it?

Thank you.
You need to specify the new camera as the active one for the scene, before rendering, like this:

bpy.context.scene.camera = cam_ob


To rotate an object around its Z axis, just do:

from mathutils import radians
my_obj.rotation_euler.rotate_axis('Z', radians(10))