[Tutor] RSH?
Mike Hansen
mhansen at cso.atmel.com
Fri Nov 4 15:11:29 CET 2005
That's exactly what I'm looking for!
Thanks,
Mike
> Subject:
> Re: [Tutor] RSH?
> From:
> Bernard Lebel <3dbernard at gmail.com>
> Date:
> Thu, 3 Nov 2005 14:16:40 -0500
> To:
> tutor at python.org
>
> To:
> tutor at python.org
>
>
> I use plink
> http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
>
> Basically you send a system command (os.system) to the plink
> executable. The actuall command will take this form:
>
> os.system( 'plink -pw %s -ssh %s@%s %s' % ( password, user, hostIP, command ) )
>
>
> Now, if you want to run a python script on the remote machine, you
> will have to send two commands (afaik). The first one to cd to the
> python script file, the second to send the python execution command:
>
> os.system( 'plink -pw %s -ssh %s@%s %s' % ( password, user, hostIP,
> 'cd /blah/blah/' ) )
> os.system( 'plink -pw %s -ssh %s@%s %s' % ( password, user, hostIP,
> 'python scriptname.py' ) )
>
>
[...]
>>On 11/3/05, Mike Hansen <mhansen at cso.atmel.com> wrote:
>>
>>>Anyone know of a way to have Python run a command on a remote machine? In
>>
>>my
>>
>>>particular case, I want to run a python program on Windows and run a
>>
>>command on
>>
>>>VMS. Would the telnetlib module do it, or is there something better?
>>>
>>>Mike
More information about the Tutor
mailing list