Blender Python Set Object to Active by Name
bpy.context.scene.objects.active = some_obj
Torrin worx
bpy.context.scene.objects.active = some_obj
context.view_layer.objects.active = ob