DEV Community

Discussion on: (Another) Simple Python File Renaming Script

Collapse
 
josephmads profile image
josephmads

Never use any code you don't fully understand.

That is a good point to keep in mind. Thanks!

I did try to address the file deleting problem in my script. By adding the for loop that first appends all of the file names to a sorted list, I was able to keep the files from being erased if the script is run twice in a row. I tested this to the best of my ability and was not able to make the script erase the files with this for loop in place. Were you able to get different results testing it?

I'm still a newbie to Python. I'm about 5 weeks into learning program so I'll be the first to tell you how much I don't know. :-)