With wxPython, how does one trigger an event whenever the whole window goes into/out of focus?  
To elaborate, I'm building a serial terminal GUI and would like to close down the connection whenever the user doesn't have my application selected, and re-open the connection whenever the user brings my app back into the foreground.  My application is just a single window derived from wx.Frame.
as WxPerl programmer i know there is 
EVT_SET_FOCUS(
EVT_KILL_FOCUS(
if you initialize this event by listening to the frame as first parameter it should work as in Perl since the API is almost the same
wxPython Whole Window Focus Event