Python one-click to delete the copied file by mistake

Now when taking pictures, sometimes multiple selection of photos accidentally becomes a copy. It is too troublesome to delete one by one, so the following script appears

import os
for file in os.listdir('.'):
    if '副本' in file:
        # os.remove(file)
        print(file)

For the first time, you can print it to see if it is to be deleted, and then uncomment it

Guess you like

Origin blog.csdn.net/azraelxuemo/article/details/129976133