I have a directory with 1600 photos and I need to save the path to each foto to a list and then to .txt file.
The photos are enumerated according to the position they should have in the list: img(0), img(1)...
and I need this position to be kept.
What I obtain is this order, so now in list index 2 I have img(10):
img(0)
img(1)
img(10)
img(100)
img(1000)
img(1001)
...
img(2)
img(2)
img(20)
img(200)
img(2000)
img(2001)
...
Apparently, I'm the only one having this issue because I didn't find any discussion about this problem. Thank you very much for helping me.