How to switch to "active" after append?
You can set the active object with this command:
If len(bpy.context.selected_objects):
    bpy.context.view_layer.objects.active = bpy.context.selected_objects[0]

The active object is now reachable by:
active_obj = bpy.context.active_object