Home arrow GIS Data & Resources arrow Scripts and Code arrow Python arrow PYTHON! directory recursion, yum...
PYTHON! directory recursion, yum... PDF Print E-mail

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 )
 
< Prev   Next >

AGRC Contacts | UGIC Contacts

feed image feed image

Utah GIS Portal © 2009 AGRC

Optimized for