srinivasan srinivas wrote:
Hi,
My requirement is i have to execute a python script on a remote machine as a 
subprocess from a python script and to get the subprocess pid of the process 
running the script. Is there anyway to do that??
I have used subprocess.popen() method to do that. I have done as following:
executable = '/usr/bin/rsh'
args = [executable, hostname, scriptname]
pid = subprocess.popen(args)
It returned the pid of rsh. But i am interested in the pid of the process 
running the script.
Can anyone help me out here?

Using os.getpid() you can find out the pid of the script and communicate it back to the caller.

-- Gerhard

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to