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

Alan Gauld alan.gauld at btinternet.com
Tue Aug 11 11:27:19 CEST 2009


"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

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list