#NEWLINE# def PumpWaitingMessages( ) : #NEWLINE# #INDENT# from ctypes import windll , byref #NEWLINE# user32 = windll . user32 #NEWLINE# msg = MSG ( ) #NEWLINE# PM_REMOVE = 1 #NEWLINE# while user32 . PeekMessageA ( byref ( msg ) , 0 , 0 , 0 , PM_REMOVE ) : #NEWLINE# #INDENT# user32 . TranslateMessage ( byref ( msg ) ) #NEWLINE# user32 . DispatchMessageA ( byref ( msg ) )