[Tutor] run python script on another computer's terminal (LAN)

pedro pedrooconnell at gmail.com
Tue Aug 11 15:04:13 CEST 2009


On 2009-08-11 05:27:19 -0400, "Alan Gauld" <alan.gauld at btinternet.com> said:

> "pedro" <pedrooconnell at gmail.com> wrote
> 
>> Hi, does anyone know how to send a command that is within a python
>> script to another computer's terminal. This is what it looks like in
>> Applescript.
>> 
>> tell application "Terminal" of machine
>> "eppc://USERNAME:PASSWORD@COMPUTER2.local"
>> do script "ls"
>> end tell
>> 
> 
> You might be better asking these kind of questions on the MacPython
> mailing lists/forums since more folks there will be familiar with what
> are fairly MacOS specific issues. Also you can get Python to talk to
> Applescript which might be the easiest way...
> 
> However in a general sense you can use ssh (or rsh?) to do that.
> You might also be able to avoid using subprocess or os.system
> by mounting the remote filesystem? That would let you you
> os.listdir() on the remote machine?
> 
> HTH

Hi Alan, I am trying to make my code as cross-platform as possible, so 
I am trying to avoid Applescript altogether. I'll try out your ssh 
suggestion and mounting the remote filesystem?
Thanks
Pete




More information about the Tutor mailing list