Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Reading all of the files in a directory into a list
I've got a program which will eventually need to play a load of images from a directory in sequence for an animation.
What I want to do is to read the filenames of all these images from the directory into a list so that I can then iterate over the list with something like [code]for x in thelistoffilenames. [/code]
What's the best way to do this?
Please help, many thanks.
"Let us smite the evil slime eating hordes who may befall us on our quest to be the ultimate programmers of the known universe!"
0 · ·