DoEvents equiv?

Mark Hammond MarkH at ActiveState.com
Fri May 11 11:14:53 EDT 2001


piet at cs.uu.nl wrote:

>>>>>>Mark Hammond <MarkH at ActiveState.com> (MH) writes:
>>>>>>
> 
> MH> Nope.  It is because Pythonwin is not processing it's event loop.
> 
> The Task-bar Icon has a menu entry: `Break into running code'. But if it is
> not responding while code is running, what value does it have?
> 
> I thought that initially there was supposed to be a separate thread for
> this icon that would respond to its events, just for this case to break
> into a python program that is in a (seemingly) endless loop.


It does.  It _usually_ works fine.  The one problem is has is when lots 
of printing is being done by the script.

In this case, the first time you hit "break" the script will indeed be 
interrupted, but there will often be huge amounts of output queued up 
that will start being printed.  Sometimes you need to do a second 
"break" to kill the output being dumped.


A simple "while 1: pass" loop breaks just fine.  I have no idea why the original poster had problems, but probably the "print" issue, or some exception handlers in the script itself.


Mark.




More information about the Python-list mailing list