I want to get a list of all images files.
imageExtensionList = ['jpg', '.arw', '.tif', 'mp4']
fileList = []
for extension in imageExtensionList:
searchStr = str(importPath) + '/**/*.' + extension
files = glob.glob(searchStr, recursive=True)
fileList.append(files)
This however creates a list of lists. I want the files to be in a single list. There seem to be too many solutions in python for reducing/flattening of lists. How do I make a flat list out of a list of lists?
However, which should I apply to this list of strings?
which results in 'P:\Import/**/*.arw' So the windows and unix path are mixed. How can I correct this?