def rename_jpg(root_directory):
Subdirectorys = glob(root_directory)
for Subdirectory in Subdirectorys[:]:
#print(Subdirectory)
img_path = glob(Subdirectory + "/*.jpeg")
for img in img_path[:]:
print(img)
new_file=img.split(".")[0]+".jpg"
print(new_file)
os.rename(img, new_file)
函數rename_jpg中傳入的路徑為下圖的紅色框的中的内容