标签:list === encoding sys lis port 脚本 改名 AC
#!/bin/env python
#encoding=utf-8
import os
import sys
allfile_name = sys.argv[1]
def delect(allfile_name):
for i in os.listdir(allfile_name):
wav_name = allfile_name + ‘/‘ + i + ‘/‘ + ‘train‘
# print wav_name
for j in os.listdir(wav_name):
line = j.replace(‘ ‘,‘‘).strip("\r").strip("\n")
oldname= wav_name + ‘/‘ + j
newname = wav_name + ‘/‘ + line
os.rename(oldname,newname)
print(oldname,‘======>‘,newname)
if __name__ == ‘__main__‘:
delect(allfile_name)
标签:list === encoding sys lis port 脚本 改名 AC
原文地址:http://blog.51cto.com/13632960/2129264