def inputhook_wx2(context):
 try:
  app = wx.GetApp()
  if (app is not None):
   assert wx.Thread_IsMain()
   elr = EventLoopRunner()
   elr.Run(time=10, input_is_ready=context.input_is_ready)
 except KeyboardInterrupt:
  pass
 return 0

def inputhook_wx2 ( context ) : try : app = wx . GetApp ( ) if ( app is not None ) : assert wx . Thread_IsMain ( ) elr = EventLoopRunner ( ) elr . Run ( time = 10 , input_is_ready = context . input_is_ready ) except KeyboardInterrupt : pass return 0
run the wx event loop .