I am new to wxPython, so please be gentle. I am trying to make a game using wxPython. I need to be able to handle events (button clicks) while the game is in progress.

The process is:

1. Deal the cards
2. Wait for user input
3. Continue accordingly

The way I have implemented it is:

```
app = wx.App()
g = Game() # calls g.Play() which executes the process above
app.Mainloop()

```

However the application freezes. I think the problem relates to being unable to respond to events while the process is being executed. How can I get around this?

I had a look at threading, but cannot see how to make this work in my case. If I create a new thread to deal with user inputs from within Game(), that will not be able to update the values in Game().

I am sure there is a "correct" way of doing this which I don't know because I am unfamiliar with wxPython. Can anyone help?