From: John H. <jd...@gm...> - 2007-04-05 13:27:46
|
On 4/5/07, belinda thom <bt...@cs...> wrote: > My app needs to look something like this: > > ------ > > create a game and display it in a matplotlib figure > > while game not over : > > if its player 1's turn, get player 1's valid mouse input, > otherwise get player 2's > You need to get out of the mold of thinking about while loops with blocking input. Instead make everything event driven and track state variables to decide which player's mouse events to process. So instead of getting a blocking input, simply do nothing on events unless you are in a certain state. You can use a timer or an idle handler for recurring processing rather than a while loop. JDH |