change_name.py
460 Bytes
import os
def changeName(path, name):
i = 1
for filename in os.listdir(path):
print(path+filename, '=>', path+str(name)+'_'+str(i)+'.jpg')
os.rename(path+filename, path+str(name)+'_'+str(i)+'.jpg')
i += 1
changeName('C:/Users/nokh9/Desktop/dog_sound_mel/barking/', 'barking')
#changeName('C:/Users/nokh9/Desktop/dog_sound_mel/lonely/', 'howling')
#changeName('C:/Users/nokh9/Desktop/dog_sound_mel/sad/', 'whimpering')