Python 在 Windows 上的时间关键型应用程序

time-critical application with Python on Windows

我 运行 在 Windows 10 上使用 Python 2.7x 的时间关键型应用程序。似乎 Windows 有时会中断我的程序几分之一秒。这种情况每隔 5 到 10 秒就会发生一次。

我怎么能 "tell" Windows 我的程序是唯一重要的东西,只要它是 运行ning?

抱歉,我不清楚我的link;我的意思是在 http://code.activestate.com/recipes/496767-set-process-priority-in-windows/:

的第二条评论中提出的 psutil 用法
import psutil, os
p = psutil.Process(os.getpid())
print(p.nice())
p.nice(psutil.HIGH_PRIORITY_CLASS)
print(p.nice())

... 产量:

32
128