Skip to content

Instantly share code, notes, and snippets.

@daejinseok
Created January 1, 2019 12:15
Show Gist options
  • Save daejinseok/7dbf79b0d5ee310233e759de1a273ac4 to your computer and use it in GitHub Desktop.
Save daejinseok/7dbf79b0d5ee310233e759de1a273ac4 to your computer and use it in GitHub Desktop.
파일 이름 변경
import glob
import os
l = glob.glob('*.jpg')
for nm in l :
print(nm[:26], '{:04d}'.format(int(nm[26:-4])), '.jpg')
os.rename(nm, nm[:26]+'{:04d}'.format(int(nm[26:-4]))+'.jpg')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment