Skip to content

Instantly share code, notes, and snippets.

@huangziwei
Created March 1, 2016 04:49
Show Gist options
  • Save huangziwei/b8868fa404c4344309f0 to your computer and use it in GitHub Desktop.
Save huangziwei/b8868fa404c4344309f0 to your computer and use it in GitHub Desktop.
rename (multiple )files
import os
import glob
filenames = glob.glob('file/path')
for i, file in enumerate(filenames)
os.rename(file, "new/file/name/%02d" % i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment