1:图片重命名 原来的图片名字格式: 改成的图片名字格式: #!/bin/bash #重命名 .png和.jpg #如果原文件的图片名称是从0开始,那么count=:从1开始,那么count= count=; set -x for img in `find . -name '*.png'|sort ${png#.*}` do ];then $count.png else $count.png fi mv "$img" "$new" let count++ done…
今天,得到一个里面都是图片的文件夹,但是图片都没有后缀,因此想用Pythton批量地为所有的文件加上".jpg"的后缀,代码如下: #-*- coding:utf-8 -*- #重命名文件 import os path = 'D:\pics' for file_path in os.listdir(path): if os.path.isfile(os.path.join(path, file_path)) == True: if file_path.find("."…