This is the current code I have right now and I'm wondering how I can get it to kill the pid.
import commands, signal
stuid = commands.getoutput("pgrep student")
deaid = commands.getoutput("pgrep daemon")
print stuid
os.kill(stuid, signal.SIGKILL)
print deaid
os.kill(deaid, signal.SIGKILL)
Edit: So, in the end, I just used os.system to get the terminal to run the kill command then place the pid after kill.
import commands, os
stuid = commands.getoutput("pgrep student")
deaid = commands.getoutput("pgrep daemon")
print stuid
os.system("kill "+stuid)
print deaid
os.system("kill "+deaid)
Overall this is my end result. Hope this helps people in the future.