[Pythonmac-SIG] run python script on another computer's terminal (LAN)
pedro
pedrooconnell at gmail.com
Wed Aug 12 17:43:26 CEST 2009
On 2009-08-11 17:55:45 -0400, Ned Deily <nad at acm.org> said:
> In article <nad-E3D0A0.13410311082009 at news.gmane.org>,
> Ned Deily <nad at acm.org> wrote:
>> In article
>> <50697b2c0908111235j42440662ic7cdffa611f96175 at mail.gmail.com>,
>> Chris Rebert <pythonmac at rebertia.com> wrote:
>>> On Tue, Aug 11, 2009 at 3:25 PM, 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
>>> 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:PASSWORD@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:PASSWORD@COMPUTER2.local/Terminal")
>>>> term.do_script("ls")
>
> has a better chance of working.
Hi Ned appscript works perfectly. Thanks for the tip. Paramiko looks
promising once I get some linux Boxes on the farm, thanks Nicholas.
Pete
More information about the Pythonmac-SIG
mailing list