Skip to content

Instantly share code, notes, and snippets.

@NickCarneiro
Created June 27, 2013 22:32
Show Gist options
  • Save NickCarneiro/5880985 to your computer and use it in GitHub Desktop.
Save NickCarneiro/5880985 to your computer and use it in GitHub Desktop.
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