| 1 |
## 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() |