Last active
December 16, 2015 08:49
-
-
Save jktravis/5408807 to your computer and use it in GitHub Desktop.
remove spaces and lowercase file names.
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
import os, argparse | |
parser = argparse.ArgumentParser(description="Remove spaces from file names and make them lowercase.") | |
parser.add_argument("file", nargs='+', help="The file to be renamed") | |
args = parser.parse_args() | |
for f in args.file: | |
print "Renaming {} to {}".format(f, f.replace(" ", "_").lower() ) | |
os.rename(f, f.replace(" ", "_").lower()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment