复制代码 代码如下:
import os,re
fs=os.listdir('xb')
for f in fs:
dirtymatch = re.search(r'\[.*?\]', f)
if dirtymatch:
dirtystring=dirtymatch.group(0)
newname=f.replace(dirtystring, '') + '.mp3'
os.rename('xb/' + f, newname)
Copyright© 2013-2020
All Rights Reserved 京ICP备2023019179号-8