Blender Python select stored object without name I would like to create several cameras, and store them as follows:

a = bpy.ops.object.camera_add()
b = bpy.ops.object.camera_add()
c = bpy.ops.object.camera_add()


This command allows me to select the camera called "Camera.001"

bpy.data.objects['Camera.001'].select = True


But if my scene already contained several cameras before I created a, b &amp; c, how would I select camera b without knowing its name?  This code doesn't work:

bpy.data.objects[b].select = True


Thanks for your help.  My python knowledge is minimal.
bpy.ops don't return items like that.

Instead, you want to work on the cameras and objects data blocks directly, like so:

camdata = bpy.data.cameras.new(name="Camera A")
a = bpy.data.objects.new(name="Camera A", object_data=camdata)


Then, link it to the currently active scene:

bpy.context.scene.objects.link(a)


You could then select the camera either, by just doing:

a.select = True


or by doing

bpy.data.objects[a.name].select = True