Skip to content

Instantly share code, notes, and snippets.

@mrdoob
Created August 28, 2012 20:58
Show Gist options
  • Save mrdoob/3504305 to your computer and use it in GitHub Desktop.
Save mrdoob/3504305 to your computer and use it in GitHub Desktop.
Renaming files in a folder consecutively.
import os
for i, filename in enumerate(sorted(os.listdir("."))):
os.rename(filename, "{0}.png".format(i))
@KelSolaar
Copy link

:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment