我试过
>>> import subprocess
>>> import os
>>> subprocess.call(["echo","Hello there"], env=os.environ)
Hello there
0
>>> subprocess.call(["nice", "19", "echo","Hello there"], env=os.environ)
nice: 19: No such file or directory
127
>>> subprocess.call(["nice", "19", "echo","Hello there"], env=os.environ, shell=True)
0
0
>>>
我不明白为什么 subprocess 不能识别nice
我的外壳运行良好没有问题
$nice -n 19 echo '你好'
你好呀