Execute a script on a remote machine
sri_annauni at yahoo.co.in
Fri Jun 20 19:56:38 CEST 2008
This is ok.
Is there any other way to find it out?
----- Original Message ----
From: Gerhard Häring <gh at ghaering.de>
To: python-list at python.org
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. 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.
Save all your chat conversations. Find them online at http://in.messenger.yahoo.com/webmessengerpromo.php
More information about the Python-list