Renaming files in a folder consecutively.
import os for i, filename in enumerate(sorted(os.listdir("."))): os.rename(filename, "{0}.png".format(i))