filename = r'D:\Work\process_cmu\cmu数据分析\cmu_img_all\\'
delet_name = ['coord.dat','Document.txt','spectrtuning.m', 'Thumbs.db']
for i in range(1, 49):
base_dir = filename + 'p' + str(i) + '\\'
# print(len(os.listdir(base_dir)))
for j, k in zip(os.listdir(base_dir),range(1, len(os.listdir(base_dir)) + 1)):
os.rename(base_dir + j, base_dir + 'c' + str(k))
second_path = base_dir + 'c' + str(k) + '\\'
if os.path.exists(second_path + 'coord.dat'):
os.remove(second_path + 'coord.dat')
if os.path.exists(second_path + 'Document.txt'):
os.remove(second_path + 'Document.txt')
if os.path.exists(second_path + 'spectrtuning.m'):
os.remove(second_path + 'spectrtuning.m')
if os.path.exists(second_path + 'Thumbs.db'):
os.remove(second_path + 'Thumbs.db')
for img, n in zip(os.listdir(second_path),range(1,66)):
os.rename(second_path + img, second_path + 's' + str(n) + '_p' + str(i) + '_c' + str(k) + '.bmp')