Executing Python Scripts on Mac using Python Launcher

Hans Mulder hansmu at xs4all.nl
Tue Jun 26 15:16:11 EDT 2012


On 26/06/12 20:11:51, David Thomas wrote:
> On Monday, June 25, 2012 7:19:54 PM UTC+1, David Thomas wrote:
>> Hello,
>> This is my first post so go easy on me.  I am just beginning to program using Python on Mac.  When I try to execute a file using Python Launcher my code seems to cause an error in terminal, when I execute the exact same piece of code and run it in windows it seems to execute as exactly intended.
>>  How can I make my python script to open up correctly using Python Launcher?  I am running 10.7 on my Mac.  I would upload a photo with the error I get but I can't seem to find the upload feature in this group.
>>
>> Thanks
> 
> Thank you for the fast response.  How can I tell if Python is in the same path as Terminal?

It isn't.  Terminal is an application and is located in
/Applications/Utilities .  Python is an executable, and is
typically located in a "bin" directory.  To find out where
it is, type

    type python

at the shell prompt (that's the first prompt you get if you
open a Terminal window).

Possible answers include:

/usr/bin/python
    This is the Python shipped by Apple

/Library/Frameworks/Python.framework/Versions/2.7/bin/python
    This is a Python from python.org

/opt/local/bin/python
    This is a Python from macports

> Is this located in the /usr folder?

If you mean /usr/bin, that's the Python that came with your Mac.
If you haven't installed any other Pythons, then yes, you must
be using that one.


Hope this helps,

-- HansM





More information about the Python-list mailing list