I have a folder with about 1000 images ordered from 1.jpg to 1000.jpg, I want to rename these names with a list "x" that I have with me.
x = ["hello", "rat", ...]
This is the list that I have, so I would like to change the names of the images from 1.jpg to hello.jpg and so on. How do I do this?
I thought of reading the file and then using os.rename(), but I dint know how to do it
with open(x) as list1:
newnames = list1.read().split(',\n')