bz2 & cpu usage

David Rushby woodsplitter at rocketmail.com
Wed Oct 20 11:30:25 EDT 2004


Benjamin Niemann <b.niemann at betternet.de> wrote in message news:<cl37a7$opn$1 at online.de>...
> Under windows do something similar using the TaskManager -> Set Priority... 
> There should some windows API call to do this from your program, 
> probably involving the win32 extension.

Indeed.
----------------------------------------
import win32api, win32process

win32process.SetPriorityClass(win32api.GetCurrentProcess(),
win32process.BELOW_NORMAL_PRIORITY_CLASS)

... Invoke the compression portion of the program ...

win32process.SetPriorityClass(win32api.GetCurrentProcess(),
win32process.NORMAL_PRIORITY_CLASS)
----------------------------------------


win32all build 159 and earlier are missing the constant
win32process.BELOW_NORMAL_PRIORITY_CLASS; that can be fixed with:
----------------------------------------
win32process.BELOW_NORMAL_PRIORITY_CLASS = 16384
----------------------------------------



More information about the Python-list mailing list