Tags » Loop

The same!

Yesterday I had this code in hand:

for aSprite in spritesList:
    for aScript in aSprite.scripts:
        #if 'createCloneOf' in aScript:
            if aScript ==  '_myself_':
                aSprite.clonesItSelf = True
        except ValueError:
            pass #script does not have clones
        if 'procDef' in aScript:
            aSprite.hasProcess = True
        if aSprite.hasProcess and aSprite.clonesItSelf:
            projectHasInterestingSprite = True
… 90 more words

Break to debug

Yesterday I had to read a very large file and take some data. Each run was around a minute. So I was losing a minute of my time for every TypeError :-). 35 more words