I have many files named file_1, file_2, another_file_1, another_file_2 etc.
How can I find the files which end with 1 and only 1.
At the moment I'm using the glob
function in a loop, such as
for i in range(len(number_of_files)):
files = glob.glob("*" + str(i+1) + ".txt")
The problem is that this gives me the files called 1, 11, 21, 31, etc. I only want file 1 one time, file 11 one time and so on.