using the bmesh simple template from the text editor, and a bit of snooping around. You should experiment with the
The context is enumerated so (source: bmesh_operator_api.h):
DEL_VERTS = 1,
This example assumes we have a mesh object in edit-mode and several faces selected. Running the script will delete edges and faces associated with the selection.
# Get the active mesh
obj = bpy.context.edit_object
me = obj.data
# Get a BMesh representation
bm = bmesh.from_edit_mesh(me)
faces_select = [f for f in bm.faces if f.select]
bmesh.ops.delete(bm, geom=faces_select, context=5)
# Show the updates in the viewport
# and recalculate n-gon tessellation.