I am writting a small script that will find a parent pid and from this point find a parent of a parent in order to kill this last parent :-)
I know it sounds stange (at least ... ) but this is really what i have to do. So
When the script starts it find it's parent pid, like this
Expand|Select|Wrap|Line Numbers
- ppid = os.getppid()
Expand|Select|Wrap|Line Numbers
- buffer = commands.getoutput("ps -Af")
My question is, is there any "python" way to get a list of active processes? I mean not using "ps - Af" command.
It's not i don't want to do it this way, i am just curious :-)
Thanks in advance for any hints!
Best regards,