0

I am trying to open bunch of .tif files and do some processing on them. I am using the following code to do this:

for images in os.listdir(folder_dir):
    if (images.endswith(".tif")):
        print(images)

The code works perfect; however, the only slight issue I have is that in one case, the files are not opened in order. See image below:

enter image description here

In the above example, it's clearly shown that picture #100 will be opened after picture #10. I expected to picture #100 will be opened after picture #99.

does anyone know why this is happening and how I can fix it?

Barmar
  • 741,623
  • 53
  • 500
  • 612
Ross_you
  • 881
  • 5
  • 22

0 Answers0