Created
June 27, 2013 22:32
-
-
Save NickCarneiro/5880985 to your computer and use it in GitHub Desktop.
This file contains 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 | |
import sys | |
import shutil | |
if len(sys.argv) != 2: | |
print 'Usage: python economist_rename.py ~/path/to/mp3s' | |
sys.exit(0) | |
mp3_path = sys.argv[1] | |
if not mp3_path[-1:] == '/': | |
mp3_path += '/' | |
print 'Renaming mp3s in ' + mp3_path | |
mp3s = os.listdir(mp3_path) | |
for file in mp3s: | |
if file[:2] == '00': | |
shutil.move(mp3_path + file, mp3_path + file[1:]) | |
print 'renaming ' + file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment