[Tutor] break
Dave Angel
davea at davea.name
Fri Mar 15 00:08:00 CET 2013
On 03/14/2013 06:38 PM, Matthew Ngaha wrote:
> i cant seem to break out of this loop. let me explain the variables you see:
>
> <SNIP>
>
>
> if Enemy.ships:
> for missile in self.missiles:
flag = False
> for rect in Enemy.rects:
assert(!flag)
> if QPoint(missile.x + 5, missile.y) in rect:
> explosion = Explosion(rect.x(), rect.y())
> self.explosions.append(explosion)
flag = True
> break
>
(untested)
With that added code, if the break ever fails, it will raise an
exception that you can then figure out.
At that point, you can figure out why your Python executable got corrupted.
more likely, you'll find that some other loop is similar enough that you
got this one confused with that one.
--
DaveA
More information about the Tutor
mailing list