0

I run a time-critical application on Windows 10 using Python 2.7x. And it seems Windows sometimes interrupts my program for a fraction of a seconds. This happens every like 5 - 10 seconds.

How can I "tell" Windows that my program is the only thing which is important as long as it is running?

  • Did you try this: http://code.activestate.com/recipes/496767-set-process-priority-in-windows/ ? – jbndlr Oct 20 '16 at 05:39
  • yes but I got an error that win32api, win32process, win32con cannot be imported? Are these modules still up-to-date..? – DonPolettone Oct 20 '16 at 06:13

1 Answers1

0

Sorry, I wasn't clear about my link; I meant the psutil usage as proposed in the second comment on http://code.activestate.com/recipes/496767-set-process-priority-in-windows/:

import psutil, os
p = psutil.Process(os.getpid())
print(p.nice())
p.nice(psutil.HIGH_PRIORITY_CLASS)
print(p.nice())

... yields:

32
128
jbndlr
  • 4,965
  • 2
  • 21
  • 31