How to sort image by name

I’ve built an app, that are displaying folder of jpg images and successfully deployed it on share.streamlit.io
https://llevraud-lps-st-lps-9aq3oq.streamlit.app

This app works on my laptop, and worked great all images are displayed in ascending order by their name file like image_001, image_002,…

Unfortunately the images are displayed in a random order on the cloud !

Code come is like the one used into this tuto https://www.youtube.com/watch?v=GG6WDeLmw6w from Python Tutorials for Digital Humanities channel. You can see it and my be find the issuehttps://github.com/llevraud/LPS/blob/main/st_LPS.py

I’d appreciate any hints :wink:. Thank you for the support!
llevraud

Hello @llevraud, welcome to the forum!

This is the normal behavior of glob – if you want to make sure they are sorted, you can explicitly sort the list that glob returns python - How are glob.glob()'s return values ordered? - Stack Overflow

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.