i am using 2 python programs with rc.local for my raspberry, first program is my main program and the other is the second program. The second program is shutdown the raspberry, but when i do the second program my first program is still running and will stopped until raspberry truly shutdown. 
I want to make the second program kill the first program before raspberry truly shutdown, how can i do it?
Maybe an easier way would be to use the shell to kill the process in question? Each process in linux has a number assigned to it, which you can see by typing
pstree -p
In your terminal. You can then kill the process by typing in
sudo kill process number
Does that help, or were you thinking of something a bit more complicated?
how to kill a python programs using another python program on raspberry?