applescript/python question

jyoung79 at kc.rr.com jyoung79 at kc.rr.com
Sat Aug 2 02:41:24 CEST 2008


I can't seem to figure this out.  I just installed Python 2.5.2 a few days ago on my OS X 10.4.11
system.  It runs fine and if I type "Python -V" in the Terminal it outputs "Python 2.5.2" which is
correct.  However, if I try to run a 'do shell script' in AppleScript which I'm wanting to run a Python
program, it reverts to using Python 2.3.  For example, if I run this code in AppleScript:

--------------------
set p to "#!/usr/bin/python
import sys
print sys.version[:3]"
set x to do shell script "Python -c \"" & p & "\""
return x
--------------------

I get "2.3".  Does anyone have any ideas why AppleScript is using the older version of Python?
Is there a way to fix this?

Thanks.

Jay



More information about the Python-list mailing list