How to find out which modes (object, edit, weight paint, pose etc) is activated using Blender's Python API? There are buttons for switching to object mode, edit mode, pose mode and others. How to make sure which of these modes is active using Blender's Python API? Any information would help! Preferably with at least a small example of two simple buttons. For example, layers I managed to do on. off. But layers are not suitable. I will be very glad to your tips. Thank you very much!
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