Skip to content

Instantly share code, notes, and snippets.

@linktoming
Created December 19, 2011 14:56
Show Gist options
  • Save linktoming/1497555 to your computer and use it in GitHub Desktop.
Save linktoming/1497555 to your computer and use it in GitHub Desktop.
Rename Files in Python
import os
i=1
for file in os.listdir("/Users/****/Downloads/Episode1"):
if os.path.splitext(file)[1] == ".gif":
os.rename(file, "2011_11_"+str(i)+".gif")
i+=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment