[python-win32] Win32 equivalent of VB doevents() or just use time.sleep()?

python at bdurham.com python at bdurham.com
Sat Nov 6 00:35:23 CET 2010


We have a bunch of command line utilities that use all the CPU
capacity available to them. Our customer has asked us to find
ways we might make these utilities more system friendly by
occassionally calling what they refered to as a win32 equivalent
of VB's (Visual Basic) doevents() function.

I googled this topic and found a Mark Hammond suggestion with
qualifications[1]:

win32gui.Pump(Waiting)Messages

Is there a recommended way to run our utilities in a more CPU
friendly way? I was thinking of calling time.sleep( P ) every N
iterations through our processing but I'm not clear on the pros
and cons of this technique vs. a strategy that proactively pumps
waiting messages.

Malcolm

[1]
http://mail.python.org/pipermail/python-win32/2005-October/003920
.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20101105/da9e49a0/attachment.html>


More information about the python-win32 mailing list