Renaming files with an auto increment number at the end in Python is very easy. I created this script because every now and then I have to rename a lot of files, like images, to a one named-based with increment number files. This script is very easy to rename files, it keeps the right file-extension and add’s a auto incremented number at the end.
Renaming files in python is easy. But renaming and keeping unique names is a bit more difficult.
With this rename and auto increment name changer it’s very ease to do all your renaming jobs.
let’s say you want to convert this list with images to something you understand
using the name “holiday-spain”
The names will come out like this:
the start folder (mine is : “profile_photos”) name the newName for the new name of the files and the startIncNumber to with what number it should start.
startfolder = os.path.join(dir_path, "profile_photos")
newName = "your-great-new-file-name"
startIncNumber = 1