我正在编写一个python脚本来检查我制作的C程序。有时,当从脚本调用我的可执行文件时,我得到了
// show html page for user selected row
// var i = the user selected row from the previous HTML page
function myFunction2(i) {
var html = HtmlService.createHtmlOutputFromFile('index2').setWidth(800).setHeight(600);
//I know the value is being correctly delivered here because
//it is being dumped out at the bottom of the page with this code
row = ['RowPicked', i];//This is not html
html.append(row);//This appends more html to the outout so it needs to be properly formatted html not google apps script code.
SpreadsheetApp.getUi().showModalDialog(html, 'Update Selected Row');
}
这是我调用可执行文件的行:
subprocess.CalledProcessError: Command Command '['./parallel_snake', 'input/input1', 'output/output1', '20000']' returned non-zero exit status -11
为什么我会收到此错误,如何摆脱它?
编辑我的代码:
p = subprocess.check_output(["./parallel_snake", "input/" + input_file, "output/" + input_file.replace("in", "out"), "20000"])
parallel_snake C程序的输入:
input_files = [f for f in listdir("input")]
num_threads = [2, 4, 6, 8]
for input_file in input_files:
print "Checking " + input_file + "\n"
for num in num_threads:
os.environ['OMP_NUM_THREADS'] = str(num)
p = subprocess.check_output(["./parallel_snake", "input/" + input_file, "output/" + input_file.replace("in", "out"), "20000"])
print "\t" + str(num) + " threads: " + str(p)