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

Kent Johnson kent37 at tds.net
Sat Oct 15 17:37:13 CEST 2005


Joseph Quigley wrote:
> This suggestion:
> 
> date = files[x]
>            Data.year = date[2:4]
>            Data.month = date[4:6]
>            Data.day = date[6:8]
> 
> 
> Doesn't work because DspImage needs a concatenated string. (you'll see 
> a  07/28/['5'] instead of the current 07/28/05.

Did you try it? Presuming your file names look something like this:
 >>> date = 'xx051015.jpg'

Taking a slice of a string gives another string:
 >>> date[2:4]
'05'

Which is exactly the same as turning the string into a list (of strings) and concatenating:
 >>> datel=list(date)
 >>> datel[2] + datel[3]
'05'

Kent

PS Please reply on list so everyone can benefit



More information about the Tutor mailing list