Skip to content

Instantly share code, notes, and snippets.

@paweloque
Created October 10, 2016 09:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paweloque/1ecf9ef089bdcd48643e8587b2a9eb77 to your computer and use it in GitHub Desktop.
Save paweloque/1ecf9ef089bdcd48643e8587b2a9eb77 to your computer and use it in GitHub Desktop.
from os import listdir, rename
from os.path import isfile, join
#path = '/Volumes/HD-PATU3/Pawel/Pictures'
path = './'
for f in listdir(path):
if not isfile(join(path, f)):
spl = f.split('_')
#print 'File: %s' % f
if spl[0].__len__() == 2:
newf = '20%s' % f
print 'New File: %s' % newf
rename(join(path, f), join(path, newf))
#for part in spl:
#print 'Part: %s' % part
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment