473,387 Members | 1,313 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

RE: applescript/python question

Hi Diez,

Thanks for your reply. I gave this a try too, but it doesn't seem to work either.

However, a gentleman just emailed me off-list recommending to use the full path to Python that is in /usr/local/bin. This is where Python 2.5 looks to be installed rather than Python 2.3 which is in /usr/bin. I ran the following code below and it works great!
--------------------
set p to "#!/usr/bin/python
import sys
print sys.version[:3]"
set x to do shell script "/usr/local/bin/python -c \"" & p & "\""
return x
--------------------
Thank you all again for your thoughts and replies. I really appreciate it!!

Jay
I guess the shebang is simply ignored - the actual interpreter is
fetched from the "Python -c"-line.

It's a bit weird that there is Python with a capital P, but what happens
if you change that to Python2.5 for example?

Diez
Aug 2 '08 #1
0 647

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

44
by: Carl | last post by:
"Nine Language Performance Round-up: Benchmarking Math & File I/O" http://www.osnews.com/story.php?news_id=5602 I think this is an unfair comparison! I wouldn't dream of developing a numerical...
114
by: Maurice LING | last post by:
This may be a dumb thing to ask, but besides the penalty for dynamic typing, is there any other real reasons that Python is slower than Java? maurice
1
by: jon | last post by:
I have an Applescript that copies highlighted or selected webpage text. tell application "Internet Explorer" set theWindowInfo to GetWindowInfo (item 1 of (ListWindows)) set theText to selected...
3
by: dvschorre | last post by:
When I'm running Script Editor, I can get Maya to draw a sphere by typing: tell application "Maya" execute "sphere" end tell When I try this using Python, I get this error message: IDLE...
2
by: | last post by:
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...
0
by: | last post by:
Hi Sean, Thanks for your fast reply. This still doesn't seem to work. I also tried changing it to #!/usr/local/bin/python since it looks like the Python 2.5 items are actually in there. I'm...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.