def get_files(subdir):
file_list = os.listdir(subdir)
file_reallist = []
for file_name in file_list:
pattern = re.compile(r'.7750.+show_card_detail.')
match = pattern.search(file_name)
if match:
loger.debug('file name is {0}'.format(file_name))
file_path = os.path.join(subdir,file_name)
file_reallist.append(file_path)
return file_reallist
def main(argv=None):
subdir = None
try:
subdir = sys.argv[1]
except IndexError:
print 'Need input param subdir'
loger.debug('Need input param subdir')
else:
print 'subdir is {0}'.format(subdir)
loger.debug('subdir is {0}'.format(subdir))
files = get_files(subdir)
网友评论