Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys, os, fnmatch, subprocess, shutil
- from collections import defaultdict
- def findFiles (path, filter):
- for root, dirs, files in os.walk(path):
- for file in fnmatch.filter(files, filter):
- yield os.path.join(root, file)
- def main(argv):
- mainDirectory = argv[0]
- outFile = open('extract.txt', 'wt')
- print('Deleting object files...')
- for file in findFiles(mainDirectory, '*.obj'):
- os.remove(file)
- print('Deleting text files...')
- for file in findFiles(mainDirectory, '*.txt'):
- os.remove(file)
- for file in findFiles(mainDirectory, '*.tri'):
- if file[:-7] != "new.tri": # Ignore generated files
- outFile.write('Extracting ' + file + '\n')
- proc = subprocess.Popen(['TriExtractor.exe', file, '-q'])
- proc.wait()
- if __name__ == "__main__":
- main(sys.argv[1:])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement