import os

path=input("请输入图片目录的路径:")
if path[-1]!='/':
    path+='/'
f=os.listdir(path)

print("pictures count:", len(f))
for i in range(0, len(f)):
    oldname=path+f[i]
    newname=path+'liudehua_'+str(i).rjust(4,'0')+oldname[oldname.rfind("."):]

    os.rename(oldname,newname)

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-13
猜你喜欢
  • 2021-11-29
  • 2021-12-30
  • 2021-10-10
相关资源
相似解决方案