[Pythonmac-SIG] Re: Pack Man issues on OS X 10.3.4

Bob Ippolito bob at redivi.com
Mon Jun 7 20:01:08 EDT 2004


On Jun 7, 2004, at 7:28 PM, Markus W. Weissmann wrote:

> On Jun 07, 2004, at 21:12, Bob Ippolito wrote:
>
>> On Jun 7, 2004, at 2:49 PM, Russell E. Owen wrote:
>>
>>> In article <a05200f00bce9f79451c4@[81.101.64.24]>,
>>>  has <hengist.podd at virgin.net> wrote:
>>>
>>>> Looks like my genius shell script just blew up. I'm open to 
>>>> suggestions:
>>>>
>>>> -  Could a better 'python exe locator' be written?
>>>
>>> Certainly.
>>>
>>> Perhaps you could base it on locate:
>>> % locate python
>>> (huge list of stuff that you'd have to grep through, unless you can
>>> figure out how to locate ^python$)
>>>
>>> Another, probably better, option is to only search the path (e.g.
>>> sys.path) for things called "python".
>>
>> find is definitely way too slow to use for this.
>>
>
> what about just "which python"? This will most probably hit the python 
> that the
> user wants. At least its the python he/she uses.

Not necessarily, a GUI app doesn't see the same environment as a 
terminal running the user's default shell does.

And if you did start up their default shell to do it, you'd have to 
deal with various edge cases.. for example, I run tcsh and I could have 
an alias for python which would result in something that looks like:

[crack:~] bob% which ls
ls:      aliased to /bin/ls -G -F -h

Not a good approach to take.

The search order I presented shouldn't have any surprises for anyone.  
Always use the Python that is distributed with the machine (most common 
case by far), unless the user chooses otherwise.  A few reasonable 
locations should be looked at (I listed the three most common).  If 
it's installed anywhere else, the user who installed it surely knows 
where they put it.

Speaking to this *specific* class of GUI application dependent on 
Python if they are installing modules for dp or fink, they *probably 
should not be using this tool*.  It has no knowledge of the "native" 
package management system.  So for this  basically leaves maybe one or 
two MacPython users who build their own and would use a GUI tool to 
install packages for it.  If either one of you decides to speak up, 
we're listening! :)  And if either one of you do speak up, it might 
also be reasonable to also have special support for framework Python 
builds (for the one or two users building+maintaining their own 
framework Python) so that they don't have to dig deep inside to find 
the "real" executable (even though I'm sure at least one of them knows 
where to find it, it would be a minor convenience).

-bob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2357 bytes
Desc: not available
Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040607/9fd9e16d/smime-0001.bin


More information about the Pythonmac-SIG mailing list