PYTHON! directory recursion, yum...

Written by Kevin Bell,


If you ever need to drill down through a directory recursively, this code will do it.  Try it out.  If you combined this sample with other sample posted on our Portal, you could fire off different gp commands based on the types of files that you encounter.  For example, you could reproject everything in your C drive, and push it to a file gdb...

import os
allFiles = os.walk(r"F:\gis\pbCat_SQLserver_Integration")

for i in allFiles:
    print i
    print "\n"

print "done"



Users' Comments  
 

No comment posted

Add your comment

08, Feb. 2008
Last Updated ( 11, Feb. 2008 )