| 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: | 413 byte(s) |
| Log Message: | Initial Import |
| # | User | Rev | Content |
|---|---|---|---|
| 1 | ninoborges | 8 | """ |
| 2 | extension batch rename | ||
| 3 | """ | ||
| 4 | |||
| 5 | import os | ||
| 6 | |||
| 7 | def ExtRename(args, dirName, filesInDir): | ||
| 8 | for file in filesInDir: | ||
| 9 | if os.path.isfile(dirName + "\\" + file): | ||
| 10 | Fhead,Ftail = os.path.splitext(file) | ||
| 11 | os.rename(dirName + "\\" + file, dirName + "\\" + Fhead+ ".pdf") | ||
| 12 | |||
| 13 | if __name__ == '__main__': | ||
| 14 | startDir = r"T:\fixMe" | ||
| 15 | arg = "" | ||
| 16 | os.path.walk(startDir,ExtRename, arg) |