[Tutor] slide show won't display the images in right order

Alan Gauld alan.gauld at freenet.co.uk
Wed Oct 12 19:02:42 CEST 2005

> When I use:
> files = os.listdir(<theimagesdirectory>)

Have you tried printing 'files'?
Are they in order there?

> it doesn't display the images in the right order! It will skip from
> ga050123.gif and go to ga050120.gif!

I suspect listdir doesn't use name order.
You probably need to do a sort() on the files list.


Alan G
Author of the learn to program web tutor

More information about the Tutor mailing list