Making selected vertex into active vertex

Hello, i’m in need of your help with this. I’m working on something with blender 2.79 script. So basically, i’m trying to make a script that works exactly like how i work manually. First, select a vertex, then click on normalize vertex weight button, after that, hide the vertex, and then repeat the process to the next vertex. I’ve worked out the ‘for loop’ code for this and it worked fine. But the normalize vertex weight code failed, because it needs the selected vertex to be active. As you can see in the image above, i’ve also submitted the code that i used for this ‘vertex selection’ code, when i run the script, the selected vertex color was orange, and an active vertex is white.
I’ve looked everywhere trying to solve this problem , from googling and reading blender api, but i don’t know how to use blender api. It’s a simple task to do in blender, but the script is sooo hard to do. Please help.

Moved from “Released Scripts and Themes” to “Python Support”