https://www.bilibili.com/read/cv16146757
确认py版本:2.7,
3.6?
1 import os, sys, re, math, openpyxl, csv 2 3 i_want_file = re.compile(r'.+\.mp4') 4 5 path='.' 6 f=os.listdir(path) 7 8 n=1 9 for i in f: 10 match=i_want_file.match(i) 11 12 if match: 13 newname="a%03d.mp4"%(n) 14 os.rename(match.group(),newname) 15 n+=1
标签:文件批量,want,python,newname,mp4,file,转载,os,match From: https://www.cnblogs.com/fancy2333/p/16928910.html