I have a folder with two different types of files i.e.
k_0_1.m
k_0_2.m
k_0_40.m
and
eq_0_1.txt
eq_0_2.txt
eq_0_40.txt
The goal is to access always both files which are corresponding i.e.
k_0_1.m, eq_0_1.txt
I started to iterate over the first type of file but how do I access the other file. The goal is that in each file are matrices which are corresponding.
for file in os.listdir('directory'):
filename = os.fsdecode(file)
if filename.startswith('k_0_'):
continue