Re: [dabo-users] will this work for a Mac?

Author: Ed Leafe

Posted: 2009-08-08 at 13:24:56

On Aug 8, 2009, at 11:49 AM, John wrote:

> I'm writing an article for the wiki and was wondering if the below

> code will

> work on a Mac to find the file 'uno.py'.

Possibly, but there are several things there that are problematic.

First, assuming that the user has access rights to /usr is never

smart. Second, Mac apps are typically self-contained; if uno.py is

needed for the app, it will be contained in the Resources subdirectory

inside the app itself, rather than installed in a system location.

Third, you should use os.sep instead of hard-coding '/' as the path

separator.

Lastly, does this actually work in Linux? Doesn't os.walk

automatically recurse? It seems that you have recursion inside of

recursion.

-- Ed Leafe

©2009 Ed Leafe