Created
October 20, 2011 04:23
-
-
Save amundo/1300411 to your computer and use it in GitHub Desktop.
Add a prefix to all the filenames in a directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from glob import glob | |
| import os | |
| files = glob('*.txt') | |
| for file in files: | |
| os.rename( file, 'brad_' + file ) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment