How can I delete mesh parts with python?
using the bmesh simple template from the text editor, and a bit of snooping around. You should experiment with the geom and context parameters.  

The context is enumerated so (source: bmesh_operator_api.h):

enum {
DEL_VERTS = 1,
DEL_EDGES,
DEL_ONLYFACES,
DEL_EDGESFACES,
DEL_FACES,
DEL_ALL,
DEL_ONLYTAGGED
};


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.

import bpy
import bmesh

# 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.
bmesh.update_edit_mesh(me, True)