[Pythonmac-SIG] My stab at a new page

Christopher Barker Chris.Barker at noaa.gov
Mon Feb 13 18:06:06 CET 2006


Bill Janssen wrote:
> You missed the first part of my message, I think.  The system version
> would be installed under /usr/libexec/, or some such place, not under
> /usr/bin/.

That is a good idea, but how do we get Apple to do it?

>  That would leave /usr/bin free for the MacPython gang to
> install its version, or at least a symlink to /usr/local/bin/pythonw.

Except that, ideally,  third parties should NEVER put ANYTHING in 
/usr/bin. However, if we put out stuff in /usr/local/bin (or 
/opt/whatever), and there was no "python" on the standard path, we'd 
have less confusion.

Way back when Redhat used python1.5 with a bunch of added extensions for 
its admen tools. All their tools had "usr/local/bin/env python" in the 
#! line. This was a pain in the *&$^&%* when you wanted to upgrade your 
standard python, just like it's a pin now with Apple.

However, all they needed to do was put a darn version on the #! line:

/usr/bin/env python1.5

Apple could do the same thing, then all their admin tools would be 
insulated from adding additional, newer pythons anywhere on the PATH.

I can't do anything about what Apple does, but I always put a version 
number in all my #! lines. This makes sure it uses the python version I 
want it used with, regardless of environment It also  makes it clear to 
me, and anyone else that may read that script, what version is was 
developed against. Yes, when I get rid of that version of python, I need 
to go change a bunch of #! lines, but I like that too, because it 
assures that I am aware of what I've changed, and I can test against the 
new version of python when I do it.

I like to see this as a universal practice in the Python world

-Chris

NOTE: Even better would be a way to specify multiple versions in order 
of preference, and a python launcher that would sort that out for you. 
This would be particularly nice on Windows, where you can only associate 
*.py with one thing. Maybe some day I'll want that enough to write it!

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer
                                     		
NOAA/OR&R/HAZMAT         (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov


More information about the Pythonmac-SIG mailing list