In a directory I have a lot of files, named more or less like this:
001_MN_DX_1_M_32
001_MN_SX_1_M_33
012_BC_2_F_23
...
...
In Python, I ha
You can use the os module to list the files in a directory.
Eg: Find all files in the current directory where name starts with 001_MN_DX
import os
list_of_files = os.listdir(os.getcwd()) #list of files in the current directory
for each_file in list_of_files:
if each_file.startswith('001_MN_DX'): #since its all type str you can simply use startswith
print each_file