📅  最后修改于: 2022-03-11 14:45:55.943000             🧑  作者: Mango
ps = subprocess.Popen(('ps', '-A'), stdout=subprocess.PIPE)
output = subprocess.check_output(('grep', 'process_name'), stdin=ps.stdout)
ps.wait()