1
我想用popen创建一个子进程。 特殊需求是在命令中使用shell方向。Python - 用重定向构造一个subprocess.popen
args = [
'/bin/cat',
'<',
'textfile',
]
process = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
env={'LANG':'[email protected]'})
processpid = process.pid
output = process.communicate()
我不想使用shell = True选项,因此在这里我的问题给你,如何实现它。
问候 斯特凡