1. 程式人生 > >python批量更改檔案字尾名

python批量更改檔案字尾名

import os
path = './test/Q1706106'
count = 1
for file in os.listdir(path):
    filename,ext =  os.path.splitext(file)
    os.rename(os.path.join(path,file),os.path.join(path,filename+".csv"))
    count+=1