Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- ################
- path = 'C:/Users/Lenovo/Desktop/Vortex AUV/Gate video frames/30' # FOLDER CONTAINING IMAGES
- count = 1 # COUNTER START POINT
- name = 'Gate' # FILE NEW NAME PREFIX
- #################
- for filename in os.listdir(path):
- newName = name + str(count) + ".jpg"
- src = path + '/' + filename
- newName = path + '/' + newName
- os.rename(src, newName)
- count += 1
- print("** Last named file was numbered {}, change count to {} if you're gonna rename another folder **".format(count-1, count))
Add Comment
Please, Sign In to add comment