Python:BufSize必须是整数

时间:2015-01-21 18:11:52

标签: python bash

我试图在我的Python脚本中运行它:

for i in array:
    subprocess.Popen("python ~/path/myMrjob.py", "--domain "+i, "~/otherPath/* > ~/otherPath2/"+i+"/output-unsorted.log")

我看到了:TypeError: bufSize must be an integer

1 个答案:

答案 0 :(得分:1)

您应该将要发送到shell的字符串列表传递给Popen as the first argument

for i in array:
    subprocess.Popen(["python ~/path/myMrjob.py", "--domain "+i, "~/otherPath/* > ~/otherPath2/"+i+"/output-unsorted.log"])