View Single Post
Old Jun 27th, 2006, 5:00 PM   #2
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 856
Rep Power: 3 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
I managed to sidestep this problem by using os.walk:

filename = 'schedule.xls'
searchdir = 'T:\Test'

for root, dirs, files in os.walk(searchdir):
    if filename in files:
        result = root + name
        break

print result
I am still interested in how the code in my last post could be fixed. Also, is there a way to specify the maximum number of subdirectories os.walk will look inside?
titaniumdecoy is offline   Reply With Quote