how can i select all objects by type using python How can i select all objects by type using python scripting. I am trying to select all empties in my scene. 

I tried using bpy.ops.object.select_by_type(type='EMPTY') but thats doesn't work.
Blender 2.7x
import bpy

objects = bpy.context.scene.objects

for obj in objects:
    obj.select = obj.type == &quot;EMPTY&quot;

Blender 2.8x
import bpy

objects = bpy.context.scene.objects

for obj in objects:
    obj.select_set(obj.type == &quot;EMPTY&quot;)

See this answer for more info.