Hi everyone,
I am using batch mode to execute Knime workflow, following instructions at https://www.knime.com/faq .
And then use python code from Is There a Way to Execute Knime Workflows with Python? .
Question : is there any way we can show any error message in cmd or Python (Jupyter Notebook) since the error is currently displayed as
Thank you!
-H
When you run an external program from Python, you should be able to access the error and output streams of that program. See for example this post:
python, shellexecute
best,
Gabriel
Hi @gab1one ,
Maybe I didn’t make it clear.
When I run the command (with an intentional typo)
# cmd options
option_cmd = r"C:\Users\username\Downloads\knime_3.6.0\knime.exe -nosplash -application org.knime.product.KNIME_BATCH_APPLICATION -noexit -consoleLog -rese - workflowDir=C:\\Users\\username\\knime-workspace\\cmd_test3"
option_cmd = os.path.join(knime_dir, option_cmd)
print(option_cmd)
t0 = time.time()
call(option_cmd, shell=True)
print("Time takes:", time.time()-t0)
print("Finished")
I only got the error in the pop-up log like this (the second window):
But when I closed the log window and let Python finish executing, there is no error message displayed:
Please let me know your thoughts. Thank you!
-H
I am not quite sure why you get the pop-up window. This might be related to how you call KNIME in Python, that puts all the output into a separate window.
The ^C
before the Time
in your output indicates that the subprocess was canceled manually.
1 Like