I'm trying to find all the files in a folder starting with 'msCam' and ending with an extension '.avi'. I manage to do so with the following code:
path = path_to_analyze
files = [i for i in os.listdir(path) if os.path.isfile(os.path.join(path,i)) and \
'msCam' in i]
print(len(files))
for file in files:
if file.endswith(".avi"):
msFileList = [os.path.join(path, file)]
print(msFileList)
But this stores only the last file found in the given 'msFileList' variable.
print(msFileList)
How can I pass all the files to be stored?
