I have a folder that has 4 different kinds of file. For example:
Type 1: 00001_a.png
Type 2: 00231_b.mat
Type 3: 00001_c.jpg
Type 4: 00001_c.png
How can I filter these files into 4 lists? My current solution can only filter based on file extension.
all_file = os.walk(input_path).next()[2] #get files only
list_one = [ fi for fi in all_file if fi.endswith("*.png") ] # "*_a.png" won't work