Author: John
Posted: 2009-08-08 at 12:49:46
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'.
import os
myflag = False
for direct in os.walk('/usr'):
for wds in direct[1]:
pathlist = '/usr/' + wds
for x in os.walk(pathlist):
for fn in x[2]:
if fn == 'uno.py':
path_to_file = x[0]+'/'+fn
myflag= True
print path_to_file
break
if myflag:
break
if myflag:
break
Johnf