views:

44

answers:

1

Hi, all,

I have to write a python script to repeat the same functions of a perl script. Inside this perl script, there is a very important step

setpriority(0,0,10) || fatalError("failed to lower priority\n"); exec(@shellCmdArray) || fatalError("failed to exec()\n");

how can I realize the same effect (lower the priority of the current and children processes)? is there such function in python? I see there is os.nice(increment) in python. Can I add os.nice(10) before I call subprocess.Popen("@shellCmdArray") to realize this?

A: 

You're looking for os.nice()

Edit: Didn't read your whole question, but after doing so, yes, it should do what you want.

Daenyth