Skip to content

Instantly share code, notes, and snippets.

@mrdoob
Created August 28, 2012 20:58
Show Gist options
  • Select an option

  • Save mrdoob/3504305 to your computer and use it in GitHub Desktop.

Select an option

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))
@mrdoob

mrdoob commented Aug 29, 2012

Copy link
Copy Markdown
Author

Please, always be a dick :)

@thomasmansencal

Copy link
Copy Markdown

:)

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