2015-03-02 42 views

回答

1

如果你想運行pstree可以使用子:

from subprocess import check_output 


out = check_output(["pstree","-u","foo"]) 
print(out) 
+0

因爲我需要所有的系統進程信息,我只有須藤權限「PS」命令,作爲根我不能使用pstree。 – chew23 2015-03-02 15:02:17

+0

你試過'ps axjf'嗎? – 2015-03-02 15:10:37

+0

請勿在Solaris ps comman上運行 – chew23 2015-03-04 13:29:09