When I execute a function with wx.CallAfter, inside it a variable is set. I want to be able to get the value of that variable on the next line, however CallAfter seems to execut
Did you try Google? I did and I got several ideas. See the following thread:
Try wx.WakeUpIdle() or wx.GetApp().ProcessIdle(). I also noticed in the docs that there is a ProcessPendingEvents method for wx.App, so you could also try wx.Getapp().ProcessPendingEvents() too.