How to find out which modes (object, edit, weight paint, pose etc) is activated using Blender's Python API?
You can get the current activated mode with the following:

bpy.context.active_object.mode


This will print things like OBJECT, EDIT, WEIGHT_PAINT, POSE etc