os.rename(ori_name, new_name)
import os
ori_path = './new_name'
folder_list = os.listdir(ori_path)
# print(folder_list)
for i in range(len(folder_list)):
folder_name = folder_list[i]
file_path = os.path.join(ori_path + '/'+ folder_name)
file_list = os.listdir(file_path)
for j in range(len(file_list)):
file_name = file_list[j]
new_name = file_name[:-5] + str(folder_name) + '-' + file_name[-5:]
ori_name = file_path + '/' +file_name
new_name = file_path + '/' +new_name
os.rename(ori_name, new_name)