Remote script execution with Python ...

Ben Hutchings ben.hutchings at roundpoint.com
Tue Mar 6 19:31:53 EST 2001


"Robert Gahan" <gahanr at gofree.indigo.ie> writes:

> Hi there,
> 
> I have installed python on a Windows PC and I am looking to
> remotely execute a script on a UNIX box from a python program.
> I need to be able to pipe a "y" to stdin also. Is there a windows
> equivalent of the unix "rexec" that could help me ?. What is the
> most appropriate way of doing this ?.

You might be able to do this with something like:

    script_in, script_out = os.popen2("rsh otherhost -c myscript")
    print >>script_in 'y'
    result = script_out.readlines()

Windows 2000 includes an rsh client but I'm not sure about other
versions of Windows.  You might want to use ssh instead for greater
security.

-- 
Any opinions expressed are my own and not necessarily those of Roundpoint.



More information about the Python-list mailing list