如何用Python中的子进程重定向输出?我在命令行中所做的事情:cat file1 file2 file3 > myfile我想对python做什么:import subprocess, shlex
my_cmd = 'cat file1 file2 file3 > myfile'args = shlex.split(my_cmd)subprocess.call(args)
# spits the output in the window i call my python program
添加回答
举报
0/150
提交
取消