Why does this code crash python?
mblume at socha.net
Sun Nov 12 13:40:58 CET 2006
<Mythmon at gmail.com> schrieb
> I am trying to make a program that will basically simulate
> a chess clock in python. ...
> ... it crashes shortly after.
Can't help you on why it crashes, but
> class eventMonitor (Thread):
> def run ( self ):
> if event.keycode == 32:
> if turn == 1: turn = 0
> if turn == 0: turn = 1
looks wrong to me. This is supposed to switch between the
players (0 and 1), but the first if changes turn to 0, the
second changes it immediately back to 1.
if turn == 1: turn = 0
else: turn = 1
More information about the Python-list