Problem to launch a workflow from a Python script

Hi guys,

I try to launch a Knime workflow from this Python script:

import argparse
import subprocess as sp
def runKnimeWorkflow(workflowPath, workflowFile):
"""
Run selected workflow in KNIME (batch mode)
input:
workflowPath -> Entire workflow path + name to run """
print("Invoke KNIME to run selected workflow: ", workflowPath.split("/")[-1])
sp.run(["/home/giuseppe/Downloads/knime_4.7.0/knime", "-nosplash", "-consoleLog", "-nosave", "-reset", "-noexit",
"-application org.knime.product.KNIME_BATCH_APPLICATION"
"-workflowDir=\""+workflowPath+"\" -workflowFile=\"" + workflowFile+"\""])
return
def main(config):
"""
Invokes a KNIME workflow in batch mode
input:
config -> contains a list of command line arguments with respective values
"""
runKnimeWorkflow(config.workflowPath, config.workflowFile)
return
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("--workflowPath", type=str, required=True)
parser.add_argument("--workflowFile", type=str, required=True)
config = parser.parse_args()
main(config)

This script take as input the path of workflowPath and the workflowFile.

But it opens the Knime window and it doens’t execute the workflow…Why?

As you can see I use the option -nosplash but it seems ignore it.

There is a bug on Knime Linux?

Can someone help me?

Thank you.