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

Bob Ippolito bob at redivi.com
Mon Jun 7 15:12:58 EDT 2004


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.

locate can easily get out of date.. especially considering if you just 
install a new python, the first thing you're going to do is install 
modules for it.

I would just take the system /usr/bin/python.  If the user wants 
something else, make them (go somewhat out of their way to) configure 
it.  Anything else can get confusing really fast.  When you present a 
dialog to the user allowing them to configure the location, populate it 
with a few sane choices (/usr/local/bin [self install], /opt/local/bin 
[darwinports], and /sw/bin [fink]) if they exist, but give them the 
option to type in another path if they want to.  Searching the path is 
unpredictable at best because chances are the user isn't going to put 
their path of choice into the environment.plist so that GUI apps would 
pick up on it (I don't do this, for example.. I just use .tcshrc).

-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/3862ec8d/smime.bin


More information about the Pythonmac-SIG mailing list