I do some edit on a mesh, but I want to know the script of what I am editing on the mesh for scripting an operator.
To know the script of what you're doing in the scene, you can see the Info Area in the Scripting Workspace. What you do in Blender will appear here, copy the script of what you did, and paste it to your script.
I deleted the cube, and add back a new cube to the scene. It showed the script in the Info Area
bpy.ops.object.delete(use_global=False, confirm=False) is the script that I deleted the cube but you just need to type
bpy.ops.object.delete() if you keep the default size and location.
The Info Area show
bpy.ops.mesh.primitive_cube_add(size=2, enter_editmode=False, align='WORLD', location=(0, 0, 0), scale=(1, 1, 1)) that I add a cube, but you just need to type
bpy.ops.mesh.primitive_cube_add() if you keep the default size and location.