#To access Blenders components import the "bpy"
#module to gain access to Blender's internal components
import bpy  

class MoveTwoOperator(bpy.types.Operator):  
    bl_idname = "object.movetwo_operator"  
    bl_label = "Move Two Operator"  
  
    def execute(self, context):  
        context.active_object.location.x += 2.0  
        return {'FINISHED'}  
  
def register():  
    bpy.utils.register_class(MoveTwoOperator)  
  
if __name__ == "__main__":  
    register()