com-object & getting pid
Posted: Mon Apr 11, 2005 12:44 pm
Hello
I am using the following code for starting a script (my_script.py) and having it running in the background (without halting the initiating php-script)
my php-script:
What i need is some way to obtain the processID of the python-script I have started in the run-method or some way of naming the process who runs this python-script. I am using windows XP, and every python-scripts i run just get the process name python.exe (and not the name of the python script).
I need to do one of these two things to be able to see if the background python script is running at an instance of time and to be able to kill it.
I hope someone can help me.
Thanks in advance
I am using the following code for starting a script (my_script.py) and having it running in the background (without halting the initiating php-script)
my php-script:
Code: Select all
$cmd = "python my_script.py";
$WshShell = new COM("WScript.Shell");
$oExec = $WshShell->Run($cmd, 1, false);I need to do one of these two things to be able to see if the background python script is running at an instance of time and to be able to kill it.
I hope someone can help me.
Thanks in advance