def inputhook_wx3():
 try:
  app = wx.GetApp()
  if (app is not None):
   assert wx.Thread_IsMain()
   if (not callable(signal.getsignal(signal.SIGINT))):
    signal.signal(signal.SIGINT, signal.default_int_handler)
   evtloop = wx.EventLoop()
   ea = wx.EventLoopActivator(evtloop)
   t = clock()
   while (not stdin_ready()):
    while evtloop.Pending():
     t = clock()
     evtloop.Dispatch()
    app.ProcessIdle()
    used_time = (clock() - t)
    if (used_time > 10.0):
     time.sleep(1.0)
    elif (used_time > 0.1):
     time.sleep(0.05)
    else:
     time.sleep(0.001)
   del ea
 except KeyboardInterrupt:
  pass
 return 0

def inputhook_wx3 ( ) : try : app = wx . GetApp ( ) if ( app is not None ) : assert wx . Thread_IsMain ( ) if ( not callable ( signal . getsignal ( signal . SIGINT ) ) ) : signal . signal ( signal . SIGINT , signal . default_int_handler ) evtloop = wx . EventLoop ( ) ea = wx . EventLoopActivator ( evtloop ) t = clock ( ) while ( not stdin_ready ( ) ) : while evtloop . Pending ( ) : t = clock ( ) evtloop . Dispatch ( ) app . ProcessIdle ( ) used_time = ( clock ( ) - t ) if ( used_time > 10.0 ) : time . sleep ( 1.0 ) elif ( used_time > 0.1 ) : time . sleep ( 0.05 ) else : time . sleep ( 0.001 ) del ea except KeyboardInterrupt : pass return 0
run the wx event loop by processing pending events only .