1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
import os
path = 'D:\\check\\Images' for file in os.listdir(path): if os.path.isfile(os.path.join(path,file))==True: newname = file.replace("test","a.xml") os.rename(os.path.join(path,file),os.path.join(path,newname))
for file in os.listdir(path): if os.path.isfile(os.path.join(path,file))==True: print file</span>
|