python获取指定路径下的所有文件
def GetFileList(dir,filelist):
newDir = dir
if os.path.isfile(fir):
filelist.append(dir.decode('gbk'))
elif os.path.isdir(dir):
for s in os.listdir(dir):
if s.endswith(".abs") or s.endswith(".sh") or s.endswith(".py") or s.endswith(".prototxt"
continue
newDir = os.path.join(dir, s)
GetFileList(newDir, filelist)
return filelist