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


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to