ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/NinoCode/Active_prgs/Carry_cat.py
Revision: 8
Committed: Sat May 5 04:21:19 2012 UTC (13 years, 10 months ago) by ninoborges
Content type: text/x-python
File size: 868 byte(s)
Log Message:
Initial Import

File Contents

# User Rev Content
1 ninoborges 8 ## Sum_imgdir_cat.py
2     ## This program will traverse through a directory, images in this case, and create a text file
3     ## with all of the file paths in that directory and subdirectories. This will be used for backing
4     ## up tiff locations when we retire old summation cases. NOTE: changed startDir to S: to use this
5     ## program in other offices too.
6     ## EBorges
7     ## 01.21.05
8    
9     import os
10    
11    
12     def CatFilesInDir(data,dirName,files):
13     for file in files:
14     extension = os.path.splitext(file)[1]
15     if extension.find('00') != -1:
16     data.write(dirName + "\\" + file + "\n")
17     if __name__ == '__main__':
18     #startDir = ('D:\\')
19     startDir = ('S:\\')
20     #startDir = r'\\ric3\images\Invensys'
21     outputFile = open(startDir + "\\ImageFileLocations.txt",'w')
22     os.path.walk(startDir,CatFilesInDir,outputFile)
23     outputFile.close()