Re: [Pythonmac-SIG] run python script on another computer's terminal (LAN)

2009-08-11 Thread Nicholas Riley
On Tue, Aug 11, 2009 at 03:35:21PM -0400, Chris Rebert wrote:
> What is "eppc://"? I can't seem to find anything on it.

It's remote Apple Events (previously known as "Program Sharing").  You
can turn it on in Sharing System Preferences.

Unfortunately in OS X, remote Apple Events are very flaky.  I'd
suggest the original questioner just use SSH, either with the built-in
OpenSSH through subprocess or with paramiko
(http://www.lag.net/paramiko/).  I've replaced all my use of remote
Apple Events with it.

-- 
Nicholas Riley 
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] run python script on another computer's terminal (LAN)

2009-08-11 Thread Pete O'Connell
Hi, eppc is what you use in applescript when you want to have an app on
another computer on you network perform a task. This is what Remote Apple
Events is for in the System Preferences>Sharing dialog.
Pete

On Tue, Aug 11, 2009 at 3:35 PM, Chris Rebert wrote:

> On Tue, Aug 11, 2009 at 3:25 PM, pedro 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:passw...@computer2.local"
> >do script "ls"
> >end tell
>
> What is "eppc://"? I can't seem to find anything on it.
>
> Cheers,
> Chris
> --
> http://blog.rebertia.com
>
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] run python script on another computer's terminal (LAN)

2009-08-11 Thread Ned Deily
In article ,
 Ned Deily  wrote:
> In article 
> <50697b2c0908111235j42440662ic7cdffa611f96...@mail.gmail.com>,
>  Chris Rebert  wrote:
> > On Tue, Aug 11, 2009 at 3:25 PM, pedro 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:passw...@computer2.local"
> > >                                do script "ls"
> > >                        end tell
> > What is "eppc://"? I can't seem to find anything on it.
> 
> "eppc:" is the protocol-identifier for Remote Apple Events, i.e. 
> executing AppleScripts on remote machines.  (That's what that Sharing 
> system preference is for.)
> 
> You want to install and use appscript.  Something like this should work:
> 
> >>> from appscript import *
> >>> term=app("Terminal",url="eppc://USERNAME:passw...@computer2.local")
> >>> term.do_script("ls")
>
> http://appscript.sourceforge.net/py-appscript/doc/appscript-manual/07_app
> licationobjects.html

Sorry, something-like-this won't quite work.  Reading better and 
testing, something like this:

>>> from appscript import *
>>> term=app(url="eppc://USERNAME:passw...@computer2.local/Terminal")
>>> term.do_script("ls")

has a better chance of working.

-- 
 Ned Deily,
 n...@acm.org

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] run python script on another computer's terminal (LAN)

2009-08-11 Thread Ned Deily
In article 
<50697b2c0908111235j42440662ic7cdffa611f96...@mail.gmail.com>,
 Chris Rebert  wrote:
> On Tue, Aug 11, 2009 at 3:25 PM, pedro 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:passw...@computer2.local"
> >                                do script "ls"
> >                        end tell
> What is "eppc://"? I can't seem to find anything on it.

"eppc:" is the protocol-identifier for Remote Apple Events, i.e. 
executing AppleScripts on remote machines.  (That's what that Sharing 
system preference is for.)

You want to install and use appscript.  Something like this should work:

>>> from appscript import *
>>> term=app("Terminal",url="eppc://USERNAME:passw...@computer2.local")
>>> term.do_script("ls")

http://appscript.sourceforge.net/py-appscript/doc/appscript-manual/07_app
licationobjects.html

-- 
 Ned Deily,
 n...@acm.org

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] run python script on another computer's terminal (LAN)

2009-08-11 Thread Chris Rebert
On Tue, Aug 11, 2009 at 3:25 PM, pedro 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:passw...@computer2.local"
>                                do script "ls"
>                        end tell

What is "eppc://"? I can't seem to find anything on it.

Cheers,
Chris
-- 
http://blog.rebertia.com
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


[Pythonmac-SIG] run python script on another computer's terminal (LAN)

2009-08-11 Thread pedro


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:passw...@computer2.local"
do script "ls"
end tell



I basically want something like os.system('ls') to be run on another 
computer in my LAN.


Thanks
Pete


___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig