How to run Python codes in Knime

Hi, I am new in using Python snippets. I would like to run an existing Python program e.g., to link the outputs of say X-means to it. Should I use JPython or the the Python Scripting (Openin Python, Python Snippet, Python Plot in Community Nodes)? Does anyone know or have detailed instructions on how to do this?  Thanks!

If you would like users to be able to configure input, I think the Python Scripting nodes may be want you want.


You may also consider keeping the python code in a separate script and using the Scripting nodes to configure a system call.   That way you don't have to worry about users having older nodes in their workflow, should you find a bug in the python code.  As long as the command line interface hasn't changed, existing workflows will be unaffected.

Can you show me how this is done? I am a novice as far as Scripting in Knime is concerned.



The following tutorial may help:

The part on the scripting nodes starts on slide 30.

There's also more info here:


The easiest way to get started, once you have the Snippet nodes installed, may be to just drag a node onto your workflow and open an existing template (choose one under the Templates tab) and then click on Edit Template in the configuration panel.  That will open an editor with the template code and you can play around with it and get an idea how it works.  I'm mostly using the R Snippet nodes.   It could be that these are better documented than the python nodes as far as tutorials, but the RGG syntax for configuring the GUI should be the same.


Good luck,



This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.