标签:bsp none style finish main 获得 rgba ini and
import os import sys import codecs import string def batch_rename(cfgname): # 获得目录下的所有文件 src_list = os.listdir("D:/picsample/picsample") print(src_list) # 获得路径 path = "D:/picsample/picsample" print(‘current path --‘ + path) # 改名 i = 0 for name in src_list: new_name = "test" + str(i) + ".jpg" i += 1 if new_name != None and i > 1: os.rename(os.path.join(path, name), os.path.join(path, new_name)) print(name + ‘-->‘ + new_name + " finish") else: print(name + ‘ not rename!‘) if __name__ == ‘__main__‘: batch_rename("D:/picsample/picsample")
标签:bsp none style finish main 获得 rgba ini and
原文地址:https://www.cnblogs.com/warmingtxdy/p/14160348.html