By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,603 Members | 979 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,603 IT Pros & Developers. It's quick & easy.

Re: Execute a script on a remote machine

P: n/a
This is ok.
Is there any other way to find it out?

----- Original Message ----
From: Gerhard Häring <>
To: py*********
Sent: Friday, 20 June, 2008 10:03:30 PM
Subject: Re: Execute a script on a remote machine

srinivasan srinivas wrote:
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. Buti 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 thescript and communicate
it back to the caller.

-- Gerhard


Save all your chat conversations. Find them online at
Jun 27 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.