For some reason the total_vert_sel will return 0. I would assume that setting the select property of a vertex to True will select the vertex but no luck so far. Can anyone tell me what i am missing?
I think it is because you are mixing code techniques. You are using the bpy.ops tools to manage the objects then you go behind the scenes and manipulate the datablock directly. bpy.ops does not know you did that. Try one way or the other.
obj = bpy.data.objects.get("Cube")
for v in obj.data.vertices:
v.select = False
obj.data.vertices[0].select = True
or
Instead of manipulating the vertex select flag directly, find a bpy.ops version of that same operation and use it instead.
Check out the Gotchas Documentation. There is a section on no updates after setting value, meshes and modes.
you could use bmesh.from_edit_mesh to avoid having to create a new bm and writing it back, but requires editmode. from_edit_mesh will wrap the actual mesh there’s practically no overhead