I\'ve got a Python program that does time-consuming computations. Since it uses high CPU, and I want my system to remain responsive, I\'d like the program to change its prio
On every Unix-like platform (including Linux and MacOsX), see os.nice
here:
os.nice(increment)
Add increment to the process’s “niceness”. Return the new niceness. Availability: Unix.
Since you already have a recipe for Windows, that covers most platforms -- call os.nice with a positive argument everywhere but Windows, use that recipe there. There is no "nicely packaged" cross-platform solution AFAIK (would be hard to package this combo up, but, how much extra value would you see in just packaging it?-)