代码示例:
for cmd in command_list:
print cmd
p = subprocess.call(['/bin/bash', '-i', '-c', cmd['command']])
如何在代码中使这些后台子进程成为前台?
答案 0 :(得分:-1)
尝试一下,输出将发送到stdout
import sys
p = subprocess.call(['/bin/bash', '-i', '-c', cmd['command']], stdout=sys.stdout)