here is a simple code:
bpy.context.scene.objects.active = ob
bpy.ops.object.editmode_toggle()
bpy.ops.mesh.delete(type='VERT')
bpy.ops.object.editmode_toggle()
me.from_pydata(verts,[],faces)
me.update(calc_edges=True)
bpy.ops.object.shade_smooth()
the problem is that the object doesn’t smooth …stays flat …what to do?