Re: python
Re: python
- Subject: Re: python
- From: Chris Espinosa <email@hidden>
- Date: Fri, 9 Apr 2004 10:40:58 -0700
On Apr 8, 2004, at 2:48 PM, Emmanuel wrote:
set cmd to "print 'hello, world'"
chrono
repeat 100
do shell script "python -c " & quoted form of cmd
end
chrono
-- 10 seconds (G3/900MHz)
And your point is?
100 invocations of a subordinate shell and 100 initializations and
invocations of Python will take time, no matter what 'cmd' is or how
fast Python executes it.
Just a note that if you want to do something efficiently in a do shell
script command, do as much as possible in one do shell script
invocation (that is, write a shell script and execute it in toto with
do shell script), rather than invoking do shell script repeatedly.
This also allows you to retain state (such as working directory,
environment variables, etc.) between shell commands.
AppleScript commands are modeless and stateless, so there's always a
cost to executing them repeatedly.
Chris
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
References: | |
| >python (From: roy whelden <email@hidden>) |
| >Re: python (From: Christopher Nebel <email@hidden>) |
| >Re: python (From: Emmanuel <email@hidden>) |