Blender 2.8+, How to execute an operator in another window?
The method from brockman. It shows one of the operator buttons. For the other direction simply use bpy.ops.object.simple_operator(val=math.pi/-2)
import bpy
import math
​
class SimpleOperator(bpy.types.Operator):
    &quot;&quot;&quot;Tooltip&quot;&quot;&quot;
    bl_idname = &quot;object.simple_operator&quot;
    bl_label = &quot;Simple Object Operator&quot;
    bl_options = {'REGISTER', 'UNDO'}
    
    val: bpy.props.FloatProperty()
    
    @classmethod
    def poll(cls, context):
        return context.active_object is not None

    @classmethod
    def description(cls, context, properties):
        return properties.arg
​
    def execute(self, context):
        for area in bpy.context.screen.areas:
            if area.type == 'IMAGE_EDITOR':
                override = bpy.context.copy()
                override['area'] = area
                bpy.ops.transform.rotate(override, value = self.val)
        return {'FINISHED'}
​
​
def register():
    bpy.utils.register_class(SimpleOperator)
​
​
def unregister():
    bpy.utils.unregister_class(SimpleOperator)
​
​
if __name__ == &quot;__main__&quot;:
    register()
​
    # test call
    bpy.ops.object.simple_operator(val=math.pi/2)

Buttons:
    #buttons with separated tooltips. Put it in a menu or a panel
    myvar = layout.operator(SimpleOperator.bl_idname, text=&quot;Rotate Counter Clockwise&quot;).arg = 'Tooltip for Rotate Counter Clockwise'
    myvar.val=math.pi/2

    myvar = layout.operator(SimpleOperator.bl_idname, text=&quot;Rotate Clockwise&quot;).arg = 'Tooltip for Rotate Clockwise'
    myvar.val=math.pi/-2