event loop problem

Mark Hammond MarkH at ActiveState.com
Mon Oct 23 17:53:18 EDT 2000


<alex116321 at my-deja.com> wrote in message
news:8t21ei$e5a$1 at nnrp1.deja.com...
> I am trying to write a simple Python script which which uses ADO
> through Python's COM extension but never exit.  For this I have
writen
> a simple while loop however this causes a problem on Windows NT.
> Sometimes other windows on NT broadcast messages which need to be
> confirmed by all running windows.  If at least one window does not
> dispatch the confirmation, the broadcaster will hang.  In C++ the
> solution is to make the main event loop listen for windows messages,
> for example:
>
> while(PeekMessage(&msg,NULL,NULL,NULL,PM_REMOVE)) {
>   TranslateMessage(&msg);
>   DispatchMessage(&msg);
> }

What you want is pythoncom.PumpWaitingMessages()

Mark.






More information about the Python-list mailing list