[Tutor] Location of found item in list.

Luke Paireepinart rabidpoobear at gmail.com
Thu Oct 19 03:48:37 CEST 2006


Chris Hengge wrote:
> Yes, I tried what you suggested, I've changed my looping structure to 
> this:
>
>     count = 0
>     for itemLine in lineList:
>         for itemDirectory in directoryList:
>             if itemLine == itemDirectory:
>                 print match.ljust(20) + itemLine.ljust(20) + 
> itemDirectory.ljust(20)
>             else:
>                 print fail.ljust(20) + itemLine.ljust(20) + 
> itemDirectory.ljust(20)
>             #os.rename(pathName + item, pathName + LineList[count])
>         count = count + 1
>
> I'm just trying to figure out where to put the break(s), but I need to 
> verify this is working since I'll be using it to rename files.. my old 
> structure did EXACTLY what I wanted (I replied to my original post 
> with more details and screen captures) as far as renaming the files.. 
> but the display was screwed up.

under what conditions do you want to break?


More information about the Tutor mailing list