import bpy,bmesh
ob = bpy.data.objects['Cube']
mesh=bmeshmesh = bmesh.from_edit_mesh(bpy.context.objectob.data)
for v in mesh.verts:
v.select = True
# trigger viewport update
bpy.context.scene.objects.active = bpy.context.scene.objects.active