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)

 

相关文章:

  • 2021-11-27
  • 2021-12-30
  • 2021-12-30
  • 2021-09-19
  • 2021-08-18
  • 2021-07-21
  • 2021-04-24
  • 2021-10-13
猜你喜欢
  • 2021-11-29
  • 2021-12-30
  • 2021-12-08
  • 2021-12-13
  • 2021-10-30
相关资源
相似解决方案